Write an algo to calculate the sum of even numbers from 1 to 100
Answers
Answered by
2
print(f"sum: {sum([n for n in range(1, 101) if n % 2 == 0])}")
Similar questions