Challenge: Chaining and Composing Iterators
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
Implement the function chained_odds_squared(numbers) that chains together the provided generator functions to process a sequence of numbers:
-
First, use the
filter_oddsgenerator to filter out even numbers from the input iterablenumbers. -
Then, use the
square_numbersgenerator to yield the square of each remaining (odd) number. -
Your function should return an iterator that yields the squared values of odd numbers from the input.
-
Do not create intermediate lists.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 5. 章 7
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください
セクション 5. 章 7