Count Down
Write a program that counts down from 10 to 1. The program should create a variable called number and assign it to the number 10. While number is greater than 0, it should display the number and then reduce number by 1.
10 9 8 7 6 5 4 3 2 1
SET number TO 10
WHILE number > 0 DO
SEND number TO DISPLAY
number = number - 1
END WHILE
number = 10
while number > 0:
print(number)
number = number - 1
# Set number to 10
number = 10
# While number is greater than 0
while number > 0:
# Display the current number
print(number)
# Reduce number by 1
number = number - 1
Extension
Extend the program to allow the user to enter what number the count down should start from. Once the count down reaches 0, the program should display “LIFT OFF!”.
What number should the count down start from? 15 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 LIFT OFF!