Project Level 2: Intermediate
This project is designed for intermediate learners who know Python fundamentals and are practicing building complete programs.
Project Description
This program helps you keep track of deadlines by allowing you to input a specific date and time. It calculates whether the deadline has already passed, is happening today, or how many days remain until the deadline.
Expected Output
A) Scenario 1: Deadline not passed
The program starts by prompting the user to enter a deadline in the YYYY-MM-DD HH:MM format.
If the submitted deadline is later than the current time and date, the program displays the message “The deadline is in x day(s). Keep working 🚀”
B) Scenario 2: Deadline passed
If the submitted date is earlier than today’s date, that means the deadline has passed, and the message “The deadline has passed 😢” is printed out.
Learning Benefits
Date and Time Handling: You will practice using the
datetime
module to parse, manipulate, and compare dates and times, a crucial skill for scheduling and time-sensitive applications.Input Parsing: You will practice accepting user input and converting it into a usable format using
strptime()
.Conditional Logic: You will practice implementing multiple conditional statements to handle various scenarios, such as past, present, and future deadlines.
String Formatting: You will practice formatting messages dynamically to provide meaningful feedback based on the calculated deadline status.
Prerequisites
Required Libraries: datetime
No need to install any library since random is a standard library.
Required Files: No external files are needed.
IDE: You can use any IDE on your computer to code the project.
Danger Zone
Once you code the project, compare it with our solution below: