Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 394 Bytes

File metadata and controls

30 lines (20 loc) · 394 Bytes

Rocket lauch

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....!!