livepython.net

91. Python Program to Print a Countdown with a While Loop

Easywhile

Overview

Count down instead of up: start high and make the counter smaller each round.

Problem Statement

Read a whole number n (0 or more). Print n, n - 1, and so on down to 1, one per line, using a while loop. Then print Liftoff!. For example, for 3:

3
2
1
Liftoff!

If n is 0, only Liftoff! is printed.

Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.

Input

One value per line. Example:

3

Output

The output for that example:

3
2
1
Liftoff!

The tests try 4 different inputs.

Learn this firstChapter 11 · Python while Loop: Repeat While a Condition Is True
solution.py
# write your code here

EXPECTED OUTPUT

15
24
33
42
51
6Liftoff!

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.