Answer to Question #270972 in Python for Chiarra

Question #270972

Only the Even Ones

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
1
Expert's answer
2021-11-24T08:04:36-0500
l = l + [int(x) for x in input().split()]
for a in l:
  if (a % 2) == 0:
    print(a)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS