Code Monkey home page Code Monkey logo

alx_be_python's Introduction

๐ŸŒŸ 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! ๐ŸŽ‰

alx_be_python's People

Contributors

jazaltron10 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.