PROJECT CONTRIBUTION REPO
Description
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
Development
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))
Prerequisites
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:
How to run the script
python3 main.py
Example
Enter the time in seconds: 20
00:20
Timer completed!
Top comments (0)