sum = 0x = 1n = 1while True: if n > 20: break sum = sum + x 第一轮运算是sum=0+1,第二轮不是应该是sum=1+2=3么?这与题目所求不同啊?怎么解释呢?
x = x * 2
n = n + 1print sum
望远
相关分类