You are on page 1of 1

#Initial list

res = []

# Input lengths
lengths = int(input())

# Add element
for i in range(lengths):
# Input elements
n = int(input())
res.append(n)

def evenNum(res): # Ham tim so chan tu 1 list va tao 1 list moi cho cac so chan do
new_list_of_even = []
for i in range(0,len(res)):
if res[i] % 2 == 0:
new_list_of_even.append(res[i])
print(new_list_of_even)

evenNum(res)

You might also like