12
External Project Contribution - Release 0.3
PROJECT CONTRIBUTION REPO
Countdown timer made using the Python time module and is a terminal game to countdown the time.
https://github.com/Python-World/python-mini-projects/pull/538
Please have python3 installed to run this project on terminal:
Python3 Installation
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('Timer completed!')
t = input('Enter the time in seconds: ')
countdown(int(t))
Modules required to be able to use the script successfully
and how to install them. Please have python3 installed to run this project on terminal:
python3 main.py
Enter the time in seconds: 20
00:20
Timer completed!
12