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. https://code.sololearn.com/c9hy8d1olv4L/?ref=app
1/23/2021 2:27:07 PM
Steve Barone6 Answers
New Answeritems_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!
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message