diff --git a/subh.ftg b/subh.ftg new file mode 100644 index 0000000..2755824 --- /dev/null +++ b/subh.ftg @@ -0,0 +1,19 @@ +Countdown time in Python + + + + + +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") + +countdown(5)