What is iteration (e.g. for loop)?17
  • Loop: repeats code while a condition holds — avoids copy-pasting the same lines by hand
  • for loop: best when you know how many times to repeat
  • while loop: best when repeating until something changes
  • Loop counter: tracks progress; increment = i++
  • Infinite loop: condition never turns false; ensure condition becomes true to avoid this