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)

πŸ‘‹ Hey, my name is Noah and I’m the one who set up this ad. My job is to get you to join DEV, so if you fancy doing me a favor, I’d love for you to create an account.

If you found DEV from searching around, here are a couple of our most popular articles on DEV: