Countdown timer program in Python ⌛

89 Views
Published
#python #tutorial #course

import time

my_time = int(input("Enter the time in seconds: "))

for x in range(my_time, 0, -1):
seconds = x % 60
minutes = int(x / 60) % 60
hours = int(x / 3600)
print(f"{hours:02}:{minutes:02}:{seconds:02}")
time.sleep(1)

print("TIME'S UP!")
Category
Bro Code
Tags
python tutorial for beginners, python course, python
Be the first to comment