New course! Every coder should learn Generative AI!
Try a free lesson- 3
That's odd code coach
Solution with python while loop d = int(input()) b = 0 i =0 while i < d : a = int(input()) if (a%2)==0: b += a i = i +1 print(b)
3 Answers
+ 1
Try out in this way:
x=0
len = int(input())
list = []
for i in range(len):
list.append(int(input()))
for i in list:
if i%2 == 0:
x = i + x
print(x)
+ 1
Do you really have to down vote it
0
What's your question?