Home > Article > Backend Development > How to end a loop in Python
How to end the loop in Python?
You can use break. If break is executed, the entire for loop will end.
The operation effect is as follows:
You can also use it continue If continue is executed, it will end the current round but not the subsequent rounds.
The operation effect is as follows:
Recommendation:《python tutorial》
The above is the detailed content of How to end a loop in Python. For more information, please follow other related articles on the PHP Chinese website!