import time def countdown(lim): i = lim for x in range(lim+1): print(i) i = i-1 time.sleep(1) countdown(10)