Editor

Rocket Countdown

#204 · Loops · Beginner · 25 XP · about 3 min

Write countdown(n) that returns the countdown for a rocket launch as a list of strings: the numbers from n down to 1, each one as a string, followed by 'Liftoff!'.

If n is 0 there is nothing to count, so the list holds only 'Liftoff!'.

Examples

countdown(3)  # returns ['3', '2', '1', 'Liftoff!']
countdown(1)  # returns ['1', 'Liftoff!']
countdown(0)  # returns ['Liftoff!']

Note

n is a whole number from 0 to 100.

Fastest solvers

Leaderboard

First solves only, ranked by stars and then time.