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

bookChallenge: 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.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 5. Розділ 7

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Секція 5. Розділ 7
some-alt