Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Chaining and Composing Iterators | Python Iterators
Pythonにおける関数型プログラミングの概念
セクション 5.  7
single

single

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_odds generator to filter out even numbers from the input iterable numbers.

  • Then, use the square_numbers generator 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.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 5.  7
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt