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

Function countdown

projects/Countdown/countdown.py:4–12  ·  view source on GitHub ↗
(time_sec)

Source from the content-addressed store, hash-verified

2
3
4def countdown(time_sec):
5 while time_sec:
6 mins, secs = divmod(time_sec, 60)
7 timeformat = "{:02d}:{:02d}".format(mins, secs)
8 print(timeformat, end="\r")
9 time.sleep(1)
10 time_sec -= 1
11
12 print("Time Up")
13
14
15if __name__ == "__main__":

Callers 1

countdown.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected