Skip to content

TMNKdaredaniel/Intro-to-Python-Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

🧮 Basic Calculator Program

A basic Python script that takes two numbers and a mathematical operator as input, then displays the operation and the result. Perfect for quick calculations! ✨


✨ Features

Addition (+) ✅ Subtraction (-) ✅ Multiplication (*) ✅ Division (/) ✅ Error handling for division by zero ✅ Clear output showing the operation and result ✅ Works with integers and floating-point numbers


🚀 How to Use

  1. Run the script in a Python environment:
    python calculator.py
  2. Enter the first number when prompted.
  3. Enter the second number when prompted.
  4. Enter the operator (+, -, *, /).
  5. See the operation and result displayed instantly!

📝 Example

Enter first number: 10
Enter second number: 5
Enter operator (addition, subtraction, multiplication, or division): *

Your Operation: 10.0 * 5.0
The Final Result: 50.0

📌 Requirements

  • Python 3.x

⚠️ Notes

  • Inputs are converted to float, so both integers and decimals work.
  • Division by zero is handled with a friendly error message.
  • Invalid operators will return an error.

🎉 License

This project is open-source and free to use. Enjoy! 😊

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages