为什么 if 必须放在前面
sum = 0
x = 1
n = 1
while True:
sum = x + sum
x = x + x
n = n + 1
if n > 20
break
print sum
答案中 if 语句放在while语句开始,跟放在最后有什么区别呢
sum = 0
x = 1
n = 1
while True:
sum = x + sum
x = x + x
n = n + 1
if n > 20
break
print sum
答案中 if 语句放在while语句开始,跟放在最后有什么区别呢
2020-03-15
举报