Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

sum of even numbers in a list in python

>>> myList = [1, 3, 5, 6, 8, 10, 34, 2, 0, 3
>>> sum(num for num in myList if not num%2)
60
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sum #numbers #list #python
ADD COMMENT
Topic
Name
1+7 =