Infinite Loops

Toy Story

Today I had some fun with infinite loops in Python. What are infinite loops? An infinite loop (or endless loop) is when you give a sequence of instructions in a computer program which ends up looping endlessly, either due to the loop having no terminating condition to make it stop, having a condition that can never be met, or having a condition that causes the loop to start over. This loop continues to loop on and on and on for all of eternity...unless you make it stop by pressing CTRL-C.

While Loops are extremely powerful but if you're not careful using them this kind of infinite looping can occur. While Loops are very useful in maintaining a state where a certain condition is met. Using While Loops is great when a program needs to loop until a particular condition occurs. Otherwise, if that condition is not met it's going to keep looping and looping till the end of time.

Want to see infinite looping in action?

Go ahead and interact with it! Click on the Play Triangle to make it run. If you want to stop the infinite loop just click on the white square button.

Wasn't that cool? Since I created a pretty cool infinite loop you know what that means right? It's time for the Woohoo Dance!

Toy Story Dance

Toy Story Dance