You've learned that a while loop repeats as long as its condition is True, and that you must change something inside the loop so it eventually stops. Now write one that counts down.
A launch sequence counts down from 5 to 1, then prints a final message. You'll build it with a while loop.
Your tasks
Given this starting value:
1. Write a while loop that runs as long as n is greater than 0
2. Inside the loop, print the current value of n
3. Still inside the loop, decrease n by 1 so the loop eventually stops
4. After the loop ends, print Liftoff!
Expected output
Constraints
- Use a
while loop — do not use for or range() here
- Make sure you decrease
n inside the loop, or it will run forever
- Print
Liftoff! only once, after the loop finishes (not indented inside it)
- Do not change the starting value of
n