DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
3+1 =
Submit