This repository contains three Python projects designed for managing time, fractions, and basic mathematical calculations. They are combined to help you handle various tasks efficiently.
. Description: A Time class to manage hours, minutes, and seconds.
. Features :
- Automatically adjusts time (e.g., excess seconds convert to minutes).
- Displays time in HH: MM: SS format.
. Use Case : Ideal for time-tracking applications.
. How to Run : Open test3.py and run python test3.py.
. Description : A Fraction class for working with fractions.
. Features :
- Addition and multiplication of fractions.
- Auto-simplifies fractions (e.g., 2/4 to 1/2).
- Displays fractions as s/m.
. Use Case : Useful for mathematical calculations with fractions.
. How to Run : Open test2.py and run python test2.py.
. Description : Functions for addition, multiplication, and converting fractions to decimals.
. Features :
- sum: Adds two fractions.
- mul: Multiplies two fractions.
- fraction_to_number: Converts a fraction to a decimal (checks for division by zero).
- Auto-simplifies results. . Use Case : Quick fraction calculations without a class. . How to Run :Open test1.py and run python test1.py.
- Python 3.x installed.
- A code editor like VS Code (optional).
- Open the desired file (test1.py, test2.py, or test3.py).
- In the terminal, run python filename.py(e.g., python test1.py).
- Check the output and enjoy!
- If you encounter errors(e.g., division by zero), check initial values(e.g., avoid setting denominators to zero).
- Edit the code add features or test changes.
yousef damqani