课程
/后端开发
/Python
/初识Python
sum = 0 x = 1 n = 1 while True: sum = sum + x x = x * 2 n = n + 1 if n > 20: break print sum
2017-11-05
源自:初识Python 5-6
正在回答
冒号错了,你那个是中文冒号,要用英文冒号
杨馨梦 提问者
sum = 0
x = 1
n = 1
while True:
sum = sum + x
x = x * 2
if n > 20:
break
n = n + 1
print sum
举报
学python入门视频教程,让你快速入门并能编写简单的Python程序