MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / countdown

Function countdown

web/public/playground/countdown.py:8–16  ·  view source on GitHub ↗
(time_sec)

Source from the content-addressed store, hash-verified

6
7# Count down from time_sec to zero, printing each second
8def countdown(time_sec):
9 while time_sec:
10 mins, secs = divmod(time_sec, 60)
11 timeformat = "{:02d}:{:02d}".format(mins, secs)
12 print(timeformat, end="\r")
13 time.sleep(1)
14 time_sec -= 1
15
16 print("Time Up")
17
18
19if __name__ == "__main__":

Callers 1

countdown.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected