Answer to Question #257681 in Python for Mae

Question #257681

Only the Even Ones


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:

33 54 32 11 8


Output:

2

54

32

8



1
Expert's answer
2021-10-27T18:51:19-0400


string =list(input().split(" ")) 
size = len(string)
for i in string:
    if (int(i) % 2==0):
        print(i)

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