DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
Provide a script that prints the sum of every even numbers in the range [0; 100].
def sum_even(): return sum(i for i in range(0, 101 + 1) if i % 2 == 0) print(sum_even())
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#Provide
#script
#prints
#sum
#numbers
#range
ADD COMMENT
Topic
COMMENT
Name
6+8 =
Submit