Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python sum comprehension

sample_list = [1, 3, 8]
result = sum(value for value in sample_list)
# It should print 12
print(result)
 
PREVIOUS NEXT
Tagged: #python #sum #comprehension
ADD COMMENT
Topic
Name
9+7 =