+ 1
How "continue" works? Somebody please help me out.
I don't want to continue learning Python without knowing this. Please somebody tell my how "continue" works.
5 Réponses
+ 2
continew 会让当前的迭代结束,"跳"到下一轮循环开始。
+ 2
Thanks!
+ 2
Thank you!
+ 1
There are two loop controls, break and continue.
break will stop a loop and execute code after the loop.
continue is used when you do not want to break out of the loop entirely. Instead you want to stop somewhere in the middle of the loop, ignore code after the continue statement, and go back to the top of the loop where you evaluate the condition for execution of the loop and if the condition is still True, you will continue in loop.
+ 1
thanks