Skip to content

Jazaltron10/alx_be_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌟 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:

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:

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:

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:

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:

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:

Your monthly savings are $[savings].
Projected savings after one year, with interest, is: $[projected_savings].

📂 Repository Structure

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:

python3 <script_name>.py

📜 License

This project is licensed under the MIT License.


Happy Coding! 🎉

Releases

No releases published

Packages

No packages published

Languages