0
有人能告诉我为什么这个嵌套循环只执行内部while部分而不是8次吗?嵌套循环不能正常工作
corCols = 10
corRows = 8
cCount = 0
for rCount in range(corRows):
while cCount < corCols:
print "***" + str(cCount)
cCount += 1
print "###" + str(rCount)
这将打印在第一次迭代通过列,然后通过行迭代,但似乎只执行一次,而部分?
这是* *运行10次,第一次'for'环运行。 –
你的意思是问为什么它没有运行80次? –
cCount不再小于corCols。顺便说一句,有一些严重的标识符名称。 – 2014-02-21 17:14:50