DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
how to sum only the odd values in python
>>> lst = [0, 1, 2, 3, 4, 5]>>> sum(n for n in lst if n % 2 != 0)9
Source by www.quora.com #
PREVIOUS
NEXT
Tagged:
#sum
#odd
#values
#python
ADD COMMENT
Topic
COMMENT
Name
1+7 =
Submit