In [2]:
import time #allows us to use the time command to add a break in numbers

myNumber = int(input('enter a number')) #tells us the number to start the function on

while myNumber > 0: #tells us if the number is greater than zero than continue the countdown
    print(myNumber) #prints the number
    myNumber -= 1 #subtracts one from the number previous number
    time.sleep(1) #tells fuction to wait one second before printing the next number
print("countdown complete") #tells when the countdown is at zero then displays a message
enter a number10
10
9
8
7
6
5
4
3
2
1
countdown complete
In [ ]: