Programming ConceptsLesson 7Free preview
Loops
This lesson is part of Intro to Programming · All levels
Summary
This lesson discusses repetition that causes a program to repeat a block of code many times over without rewriting it repeatedly. Available for loop for counted repetition and while loop running during its condition is still true. Break stops the repetition completely while continue on to the next iteration.
Key points
- Loop repeats the block of code to avoid duplication
- For is used when the number of repetitions is known
- While walking while still in condition
- Break out of the loop; continue on to the next iteration
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.