【发布时间】:2009-09-14 12:43:21
【问题描述】:
我是 python 编程的初学者。我编写了以下程序,但它没有按我的意愿执行。代码如下:
b=0
x=0
while b<=10:
print 'here is the outer loop\n',b,
while x<=15:
k=p[x]
print'here is the inner loop\n',x,
x=x+1
b=b+1
有人可以帮助我吗?我真的会感激不尽! 问候, 吉拉尼
【问题讨论】:
-
你想让它做什么?解释更多
-
输出是什么?你期望它是什么?
-
你对代码有什么要求?
-
什么是 p?什么是k?你想让它重新进入内循环吗?如果是这样,您需要在外部循环的顶部将 x 重置为 0。
-
谢谢我得到答案............!
标签: python while-loop