Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python: sum of all even numbers

def sum_evens(numbers):
    total = 0
    for x in numbers:
        if x % 2 == 0:
            total += x
    return total 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sum #numbers
ADD COMMENT
Topic
Name
8+7 =