by CodeChum Admin
I have a list of 3 numbers here with me that's already in the code editor, but I want you to add some more to this list by inputting some more numbers yourself in one line and then, print out only the even numbers from the list.
Can you do that for me?
Input
A line containing integers separated by a space.
33·54·32·11·8
Output
Multiple lines containing an integer.
2
54
32
8
lst_of_numbers = [1, 2, 3]
for num in input().split():
lst_of_numbers.append(int(num))
for num in lst_of_numbers:
if num%2 == 0:
print(num)
Comments
Leave a comment