Using the break statement outside of a loop causes an error what's that means?

3rd Oct 2016, 12:42 PM
sarang tk
sarang tk - avatar
2 Answers
+ 1
What is it that you don't understand? Just don't use break outside of a loop.
3rd Oct 2016, 2:52 PM
Zen - avatar
+ 1
What does 'break' do? It exits loops. If you use it outside of a loop, python will throw an error. It's similar to trying to take a "lunch break" at work when you weren't even working in the first place. It just doesn't make sense.
3rd Oct 2016, 4:31 PM
Kirk Schafer
Kirk Schafer - avatar