1.break End Loop
Count = 0while Count <: print (' Hello,jay ', count) break count = count+1
The result of this code is that it will only print once "Hello,jay". Since a break is encountered, the loop is ended, and the statements in the loop body are not executed.
2.continue jump out of this cycle, in the loop body, again cycle
Cases:
Count = 0while Count <: print (' Hello,jay ', count) continue count = count+1
The effect of this code will be a dead loop, and it will always print "Hello,jay". Because count never equals 10, every time the code arrives, the continue will start executing again from the while loop.
PS: In order to intercept this code running results diagram, the code after the run did not actively end the run, the computer suddenly alarm, CPU temperature 81 ℃, special scare me a jump ┭┮﹏┭┮
The difference between break and continue in Python