Python Forum

Full Version: countdown script not working..plz help what is mistake
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
countdown script not working..plz help what is mistake



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')
What exactly is not working?