sum even numbers in python code example
Example: 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())
def sum_even():
return sum(i for i in range(0, 101 + 1) if i % 2 == 0)
print(sum_even())