Even numbers

Report a typo

Define a generator even that produces even numbers (0, 2, 4, 6, ...).

For a given number n, print out the first n ones on separate lines.

Sample Input 1:

2

Sample Output 1:

0
2

Sample Input 2:

5

Sample Output 2:

0
2
4
6
8
Write a program in Python 3
n = int(input())


def even():
yield ...


# Don't forget to print out the first n numbers one by one here
___

Create a free account to access the full topic