What are some common errors when creating loops?
Loops can be tricky if you aren’t careful, and can end up crashing your program if they aren’t given conditions that can become
False eventually. Some common issues are:
- Conditions that never possibly become
False, causing infinite loops and crashing.
- Forgetting to put the colon
:after the loop’s declaration.
- Not indenting code you want to run inside of a loop