Loops represent the concept of repeating a process over and over again. Constructing loops are one of the core parts of a program. A loop’s condition must evaluate to true or false. If the loop’s condition is true, the loop will continue to execute until it becomes false. If a loop never evaluates to false, it will turn into a infinite loop that will continue forever. Since loops can fall into this problem of looping forever, there are certain keywords that can help you decide to keep looping or to stop.
A break can be used to terminate a loop.
A continue is used to keep a loop iterating.
Computers love to be in loops, and later in your studies, you will find out that loops compose a large part of all programs. Start getting comfortable with the idea of a loop.
I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More