Write a 0-10000 even number and

Here is a program that calculates the sum of all even numbers from 0 to 10000:

sum =0
for i in range(0, 10001, 2):
    sum += i
print("0-10000的偶数和为:", sum)

The answer is: 250050

Guess you like

Origin blog.csdn.net/weixin_35755188/article/details/129505939