Put in order · Python course · Module 1: Python Basics

The while Loop

Arrange the while loop so that it prints 5, 4, 3, 2, 1 in turn:

Items to put in order

  • print(water)
  • water = water - 1
  • while water > 0:
  • water = 5
Show the answer

Correct order:

  1. water = 5
  2. while water > 0:
  3. print(water)
  4. water = water - 1