为啥这两段输出的结果不一样啊。 。 。没看出来区别
# Enter a code
num = 0
sum = 0
while True:
if num > 1000:
break
sum = sum + num
num = num + 2
print(sum)
n = 0
s = 0
while True:
if n > 1000:
break
n = n + 2
s = s + n
print(s)
# Enter a code
num = 0
sum = 0
while True:
if num > 1000:
break
sum = sum + num
num = num + 2
print(sum)
n = 0
s = 0
while True:
if n > 1000:
break
n = n + 2
s = s + n
print(s)
2021-05-27
举报