how to make countdown in python code example
Example 1: how to make a minute counter in python
counter = 1
print(counter)
import time
while True:
time.sleep(60)
counter += 1
print(counter)
Example 2: py countdown
import time
def countdown(t):
while t:
mins, secs = divmod(t, 60)
timer = '{:02d}:{:02d}'.format(mins, secs)
print(timer, end="\r")
time.sleep(1)
t -= 1
print('Fire in the hole!!')
t = 10
countdown(int(t))
Example 3: how to make a timer in python
import time
import playsound
question = int(input('How many seconds to wait: '))
time.sleep(question)
playsound.playsound('Hello.mp3')