Apr 2, 2025
But it should be:
def get_even(numbers):
yield from (num for num in numbers if num % 2 == 0)The yield from keyword indicates that the function is a generator, and that’s better for type-checking and automatic tools.
But it should be:
def get_even(numbers):
yield from (num for num in numbers if num % 2 == 0)The yield from keyword indicates that the function is a generator, and that’s better for type-checking and automatic tools.