← All lectures

Lecture 13 · 30 min

Nested Loops

Placing one loop inside another — used for tables, patterns, and multi-dimensional iteration.

Nested whileNested forNumber & star patternsContinue in nested loops
Slide 1 / 16

What is a nested loop?

A nested loop is simply a loop inside another loop.

  • The outer loop controls how many rows (or passes) happen
  • The inner loop runs completely from start to finish for every single iteration of the outer loop

Think of it like a clock: the seconds hand (inner) makes one full revolution for every tick of the minutes hand (outer).

← / → navigateF fullscreenEsc exit⌘K search