A catalog of data structures and problems with approaches to solve them
Simulate a rocket launch with a countdown (9, 8, 7, …) in seconds.
import time
def countdown(value):
if value > 0:
print(value, end=" ")
time.sleep(1)
if value == 0:
print("\nLift off....!!")
return
countdown(value - 1)
countdown(10)
10 9 8 7 6 5 4 3 2 1
Lift off....!!