Python continue, what is going wrong? | SoloLearn: Learn to code for FREE!


Python continue, what is going wrong?

Hello Python pros, Where is my code wrong? I am dong a challenge problem and the answer is supposed to be 6026 but mine is comimg out to 4920 or something. The problem states that it should skip the odd numbers and only sum the even ones.

1/23/2021 2:27:07 PM

Steve Barone

6 Answers

New Answer


if num % 2 != 0:


items_list = [23, 555, 666, 123, 128, 4242, 990] sum_of_even = 0 for item in items_list: if item % 2 == 0: sum_of_even += item print(sum_of_even) i make good result with this one (=6026)


ah of course thank you! its the easy things like that, that get missed hehe. appreciate it!


thanks for the different method Jan P.E. Steinert


Would be great if you could mark my answer as correct too. :-D


thanks Jan P.E. Steinert i will give it a try and see!