课程
/后端开发
/Python
/初识Python
x=2**(n-1)
n=n+1
sum=sum+x
if n>20:
break
2016-10-01
源自:初识Python 5-6
正在回答
Do you want something like below?
n = 1
sum = 0
while True:
x = 2**(n-1)
n = n + 1
sum = sum + x
if n > 20:
print sum
qq_凮残淩度zkm_03844082 提问者
举报
学python入门视频教程,让你快速入门并能编写简单的Python程序