Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- def countdown_timer(duration):
- while duration > 0:
- mins, secs = divmod(duration, 60)
- timer_display = '{:02d}:{:02d}'.format(mins, secs)
- print(timer_display, end='\r')
- time.sleep(1)
- duration -= 1
- print("Timer complete!")
- duration = 60 # 1 minute
- countdown_timer(duration)
Advertisement
Add Comment
Please, Sign In to add comment