Python Quest

Track 4 · Lesson 5 of 11

while loops and loops that never end

Repeat while a condition stays true, choose between while and for, and recognise, stop and fix infinite loops.

About 40 minBeginner4 exercises

You will be able to

  • Write a while loop that repeats as long as a condition is true
  • Make sure every while loop changes something that eventually ends it
  • Choose between a for loop and a while loop for a task
  • Recognise an infinite loop, stop it, and find its cause by tracing

Included with a Formula Quest membership

It has 4 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.

View Formula Quest memberships

Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.