Section outline

  • Computers are famous for being able to do repetitive tasks without getting bored. Loops allow you to run the same block of code multiple times. Whether you want to repeat a task a set number of times (for loop) or keep going until a specific goal is reached (while loop), loops are the key to repetition.