Loops in Python
A loop repeats a block until you stop it. for walks each item in a list, string, or range. while repeats while a condition stays true. Pick for when you know the items. Pick while when you wait until something becomes false — like “until the user types quit”.
break leaves the loop. continue skips the rest of this round. pass does nothing. while True without a break or an update never ends — the terminal just sits there. That infinite-loop trap is worth one sentence in the viva.
Loops in Python — output — for 1 2 3 then while 3 2 1.
Define loop, then for vs while in one line each.