How Logic Works

Loop

A structure that repeats a block of code multiple times.

Definition

A structure that repeats a block of code multiple times. A loop can run a set number of times, or keep running until a condition changes. Loops let programs do repetitive tasks efficiently.

Example

for student in class_list: print(student.name) — this loop goes through every student in the list and prints their name, one by one.

See it in context Learn how Loop fits into the bigger picture of how software actually works.

Read the Guide →