Loops are a sequence of instructions that is repeated until a certain condition is satisfied. This allows you to conveniently repeat codes without having to make a whole new line. When we want to run a code a specific number of times a “for loop” is used. When we don’t know the number of times the loop should run a “while loop” is used. The three parts of a loop are the keyword that begins the loop, the condition, and the keyword that ends the loop.
Reader Interactions
Comments
Leave a Reply
You must be logged in to post a comment.
Beckett Houck says
Also, the loop is repeated until the condition is false; if the condition is true, then the loop keeps repeating.