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?
#Assume this is your list
list1 = [2,5,6]
#my list
list2 = [5,7,8]
for i in list1 + list2:
if i % 2 == 0:
print(i)
2
6
8
Comments
Leave a comment