if n>20 放在前后位置有什么区别吗
放在后面:
sum = 0
x = 1
n = 1
while True:
sum=sum+x
x=x*2
n=n+1
if n>20:
break
print sum
放在前面:
sum = 0
x = 1
n = 1
while True:
if n>20:
break
sum=sum+x
x=x*2
n=n+1
print sum
放在后面:
sum = 0
x = 1
n = 1
while True:
sum=sum+x
x=x*2
n=n+1
if n>20:
break
print sum
放在前面:
sum = 0
x = 1
n = 1
while True:
if n>20:
break
sum=sum+x
x=x*2
n=n+1
print sum
2019-03-21
举报