Skip to content

Instantly share code, notes, and snippets.

@icecore2
Last active March 31, 2020 13:56
Show Gist options
  • Save icecore2/29cd586ea77bd02558da2a293f0f9e20 to your computer and use it in GitHub Desktop.
Save icecore2/29cd586ea77bd02558da2a293f0f9e20 to your computer and use it in GitHub Desktop.
Countdown
import time
def countdown(t):
while t:
mins, secs = divmod(t, 60)
timeformat = '{:02d}:{:02d}'.format(mins, secs)
print(timeformat, end='\r')
time.sleep(1)
t -= 1
print('Goodbye!\n\n\n\n\n')
timer = int(input("Please enter time counter: "))
countdown(timer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment