159k views
4 votes
# Your task is to modify the previous examples code to

# print out all the even numbers from 1 to N where N is
# an int from the user

# Your task is to modify the previous examples code to # print out all the even numbers-example-1
User Twi
by
4.9k points

1 Answer

1 vote

Answer:

n = int(input('N: '))

for i in range(1, n + 1):

if i % 2 == 0:

print(i)

User Fabio Magarelli
by
5.4k points