Nested WHILE loops in Python

岁酱吖の 提交于 2019-12-04 07:06:15

You're not resetting b to 0 right inside your outer loop, so b stays at the value it had after the first leg of the outer loop -- 4 -- and the inner loop never executes again.

The for loops work fine because they do reset their loop control variables correctly; with the less-structured while loops, such resetting is in your hands, and you're not doing it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!