Summary
In this chapter, we explored a variety of loops such as the FOR
loop, WHILE
loop, and REPEAT
loop. We also explored the theoretical side of loops, such as what counter, post check, and precheck loops are, as well as all the mechanics that go behind them. In all, you should have a decent understanding of how loops work by this point. Now, if you are still a little unsure, that’s okay. Loops can be tricky to understand, and many entry-level programmers will often struggle with them at first. If you do find yourself in this category, please go back and work through the example again and try to make a few of your own. Above all else, be patient and practice!
Now, there are many applications for loops. What we explored in this chapter barely scratched the surface of what loops are capable of and how they are used in a real-world setting. In the next chapter, we are going to explore how loops can help us do a very vital task: sorting!