Skip to content
Code ReadingSum of the Evens
Break the Code

Sum of the Evens

Write a list for which this function gives the wrong answer.
1def sum_evens(values):
2 total = 0
3 for v in values:
4 if v > 0 and v % 2 == 0:
5 total += v
6 return total