Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jazaltron10/alx_be_python
https://github.com/jazaltron10/alx_be_python
exceptions-and-error-handling oop python shell unittesting
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jazaltron10/alx_be_python
- Owner: Jazaltron10
- Created: 2024-06-18T16:47:54.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-07-16T13:21:43.000Z (6 months ago)
- Last Synced: 2024-07-16T15:55:29.353Z (6 months ago)
- Topics: exceptions-and-error-handling, oop, python, shell, unittesting
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🌟 Python Introduction Tasks 🌟
Welcome to the **Python Introduction Tasks** repository! This collection of Python scripts is designed to help you practice basic arithmetic operations, variable assignments, user input handling, and simple calculations. Let's get started!
---
## 📋 Tasks Overview
### 🧮 0. Basic Arithmetic Exercise
**Objective**: Practice basic arithmetic operations in Python.**Instructions**:
- Create `basic_operations.py`.
- Define `number1` and `number2` with values `10` and `5`.
- Perform addition, subtraction, and multiplication.
- Print results in the format: `[operation] of [number1] and [number2] is [result]`.**Expected Output**:
```plaintext
Addition of 10 and 5 is 15
Subtraction of 10 and 5 is 5
Multiplication of 10 and 5 is 50
```### 💰 1. Simple Interest Calculator
**Objective**: Calculate simple interest using arithmetic operations.**Instructions**:
- Create `simple_interest.py`.
- Define `principal = 1000`, `rate = 0.05`, `time = 3`.
- Calculate simple interest: `I = P * R * T`.
- Print result: `The simple interest is: [interest]`.**Expected Output**:
```plaintext
The simple interest is: 150.0
```### 📐 2. Calculate the Area of a Rectangle
**Objective**: Calculate the area of a rectangle using length and width.**Instructions**:
- Create `rectangle_area.py`.
- Define `length = 10` and `width = 5`.
- Calculate area: `Area = length * width`.
- Print result: `The area of the rectangle is: [area]`.**Expected Output**:
```plaintext
The area of the rectangle is: 50
```### ⏳ 3. Convert Hours to Seconds
**Objective**: Convert hours to seconds.**Instructions**:
- Create `hours_to_seconds.py`.
- Define `hours = 2`.
- Calculate seconds: `seconds = hours * 3600`.
- Print result: `[hours] hour(s) is [seconds] seconds`.**Expected Output**:
```plaintext
2 hour(s) is 7200 seconds
```### 👶 4. User Input Age Calculator
**Objective**: Calculate user's age in a future year based on current age input.**Instructions**:
- Create `future_age_calculator.py`.
- Prompt user for current age.
- Calculate age in 2050 (assuming current year is 2023).
- Print result: `In 2050, you will be [age] years old`.**Expected Output**:
```plaintext
In 2050, you will be [age] years old
```### 💸 5. Personal Finance Calculator (Advanced)
**Objective**: Calculate monthly savings and project annual savings with interest.**Instructions**:
- Create `finance_calculator.py`.
- Prompt user for monthly income and expenses.
- Calculate monthly savings: `Monthly Savings = Income - Expenses`.
- Project annual savings with 5% interest.
- Print results.**Expected Output**:
```plaintext
Your monthly savings are $[savings].
Projected savings after one year, with interest, is: $[projected_savings].
```---
## 📂 Repository Structure
```plaintext
alx_be_python/
└── python_introduction/
├── basic_operations.py
├── simple_interest.py
├── rectangle_area.py
├── hours_to_seconds.py
├── future_age_calculator.py
└── finance_calculator.py
```---
## 🚀 How to Run
Execute each script using Python 3:
```bash
python3 .py
```---
## 📜 License
This project is licensed under the MIT License.
---
**Happy Coding!** 🎉