Initial upload
This commit is contained in:
commit
bf8a8f965d
7 changed files with 77 additions and 0 deletions
14
countdown.py
Normal file
14
countdown.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import time
|
||||
|
||||
def countdown(t):
|
||||
while t:
|
||||
mins, secs, = divmod(t, 60)
|
||||
timer = '{:02d}:{:02d}'.format(mins, secs)
|
||||
print(timer, end="\r")
|
||||
time.sleep(1)
|
||||
t -= 1
|
||||
print('Countdown complete!')
|
||||
|
||||
t = input("Enter the time in seconds: ")
|
||||
|
||||
countdown(int(t))
|
||||
Loading…
Add table
Add a link
Reference in a new issue