Why do I get an infinite loop?



Why do I get an infinite loop?


If you’ve incremented num outside of the while loop, then it will never be reached. When a while loop is entered, it only runs the code indented to be inside of it each time it loops. This means that if you incremented num but didn’t indent it to be in the loop, it never gets executed when the loop runs, and our while condition never becomes false!

FAQ: Learn Python- Loops - While you're at it

Getting caught in an infinite loop means you cannot reset the interface so it’s impossible to finish the lesson.


you can refresh the web page? At least, within codecademy you can


Catching the same problem. Even logout/login or clearing local storage + clearing cache + hard reboot doesn’t help


So what did you do instead


why don’t you guys close out of the tab? and search up “codecademy” on google? never thought of that!?