DEV Community

Mohammad Alsuwaidi
Mohammad Alsuwaidi

Posted on

Python program that Counts down time

I Made a program that counts down the time and at the end makes a sound when the times up



import sys
import time
import os

a = int(input("Enter the amount of seconds: "))
if a >= 1:
    for i in range(a - 1, 0, -1):
        print i, "seconds"
        time.sleep(1)
    print"Time is up"
    os.system('say "Time is up."')
else:
    sys.exit()

Enter fullscreen mode Exit fullscreen mode

Top comments (0)