import time
def countdown(time_sec):
while time_sec:
mins, secs = divmod(time_sec, 60)
timeformat = '{:02d}:{:02d}'.format(mins, secs)
print(timeformat, end='\r')
time.sleep(1)
time_sec -= 1
print("stop")
num=int(input("Set Your Timer in Sec : "))
countdown(num)
#clcoding.com
Set Your Timer in Sec : 10 stop1
0 Comments:
Post a Comment