Python Project – Countdown Timer

Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python

Program 1

# CountDown Application
import time

def countdown(t):
    while(t):
        mins,secs=divmod(t,60)
        timer = f'{mins:02d}:{secs:02d}'
        print(timer,end="\r")
        time.sleep(1)
        t=t-1
    print("Time's up!") 



# Main calling
seconds=int(input("Enter time in seconds: "))
countdown(seconds)

 

Did you know we work 24x7 to provide you best tutorials
Please encourage us - write a review on Google

courses
Image

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *