Last active
March 31, 2020 13:56
-
-
Save icecore2/29cd586ea77bd02558da2a293f0f9e20 to your computer and use it in GitHub Desktop.
Countdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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