Skip to content

A Python script that takes a start time, a duration, and an optional starting day as inputs and calculates the resulting time

Notifications You must be signed in to change notification settings

aymane66/time-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Time Calculator

A simple Python script to add a duration to a given start time and calculate the resulting time, including optional considerations for days of the week.

Description

The Time Calculator is a Python script that takes a start time, a duration, and an optional starting day as inputs and calculates the resulting time. It handles time in the format HH:MM AM/PM and can also account for days of the week.

Features

  • Addition of a duration to a start time.
  • Handling of AM/PM time format.
  • Optional consideration of days of the week.

How to Use

  1. Ensure you have Python installed on your system.

  2. Clone the repository to your local machine.

    git clone https://github.com/aymane66/time-calculator.git
    
  3. Navigate to the project directory:

    cd time-calculator
    
  4. Run the script using the following command:

    python main.py
    
    

What I Learned

  1. Time Handling in Python: I learned how to manipulate time in Python, including parsing time strings, performing arithmetic operations, and formatting time in a user-friendly manner.

  2. User Input and Validation: Implementing user input and ensuring its validity were crucial aspects of this project. I explored methods to handle user input and incorporated error checking to enhance the robustness of the script.

  3. Modular Programming: Breaking down the functionality into separate modules (time_calculator.py and main.py) allowed for a more organized and maintainable codebase.

  4. Working with Dates and Days of the Week: Handling days of the week and calculating days later involved dealing with date-related concepts. This project provided me with hands-on experience in managing dates and understanding how they interact with time.

About

A Python script that takes a start time, a duration, and an optional starting day as inputs and calculates the resulting time

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages