From 483d097f23e59a0f08067f8b4a888f49b9e51875 Mon Sep 17 00:00:00 2001 From: subh6678 <92633447+subh6678@users.noreply.github.com> Date: Wed, 20 Oct 2021 09:46:56 +0530 Subject: [PATCH] Create subh.ftg --- subh.ftg | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 subh.ftg 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)