Home > other >  Beginners Python: why break the program runs to return it while True to cycle again?
Beginners Python: why break the program runs to return it while True to cycle again?

Time:10-26


Why the program run to return while it True to cycle again?

CodePudding user response:

Refer to my blog: https://blog.csdn.net/lanzhen001/article/details/109011814 do statement

CodePudding user response:

Thank you, for while and nested, bad distinguish who is who break and continue

CodePudding user response:

Break for a while and have an effect for loop, the file is outer while loop, the inner layer is 2 a for loop, two break belongs only to the middle of the for loop block, so just quit in the middle of the for loop, no exit while loop,

CodePudding user response:

Break can jump out of the cycle, but you this is a nested loop, it jump out to you while loop inside,

CodePudding user response:

Break out that it is in circulation, the only break within a for loop, the for loop inside the while loop, so after the break out of the for loop, but arrived in the while loop, so there is no exit while loop,
  • Related