while里面两行顺序不一样,结果不一样
num = 1
sum = 1
while num <= 10:
sum = sum * num
num = num + 1
print(sum)
和
num = 1
sum = 1
while num <= 10:
num = num + 1
sum = sum * num
print(sum) 先乘再加和先加再乘,这两种结果为什么不一样
num = 1
sum = 1
while num <= 10:
sum = sum * num
num = num + 1
print(sum)
和
num = 1
sum = 1
while num <= 10:
num = num + 1
sum = sum * num
print(sum) 先乘再加和先加再乘,这两种结果为什么不一样
2021-09-16
举报