← Innovation PlaygroundMISSION 22 / 100 · Coding Studio

While loop countdown

Trace a countdown until zero.

1. Explore the controls

Change the inputs and observe the model's response.

2. Observe the results

Printed values5, 4, 3, 2, 1

How the model works

while count > 0:
  print(count)
  count -= decrement
YOUR MISSION

3. Reach the target

Adjust the controls to obtain the following output. Multiple valid solutions may exist.

Printed values8, 6, 4, 2
Need a hint?

The loop ends before printing zero or a negative value.

Explore, then check your answer.

Simplified educational model. No real hardware is controlled. Code examples are illustrative and not executed as arbitrary programs.