import time
i = 4
while i > 1:
i -= 1
# delay of 1 second.
time.sleep(1)
print(i)
# output will be 3, (delay of 1 sec) 2, (delay of 1 sec) 1
# import the time module
import time
# define the countdown func.
def countdown(t):
while t:
mins, secs = divmod(t, 60)
timer = '{:02d}:{:02d}'.format(mins, secs)
print(timer, end="
")
time.sleep(1)
t -= 1
print('Fire in the hole!!')
# input time in seconds
t = input("Enter the time in seconds: ")
# function call
countdown(int(t))