Skip to content

This is a beginner-friendly Simple Calculator built using Python. It performs basic arithmetic operations like addition, subtraction, multiplication, and division. It's a great project for learning how to take user input and use conditionals to perform different actions based on choices.

License

Notifications You must be signed in to change notification settings

janee1768/Simple-Calculator.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฎ Simple Calculator

A beginner-friendly yet powerful command-line calculator built in Python. This project showcases clean coding practices, error handling, and user input validation while performing basic arithmetic operations.

๐Ÿš€ Features

โž• Addition

โž– Subtraction

โœ–๏ธ Multiplication

โž— Division (with zero-division handling)

๐ŸŸฆ Square of a number

๐Ÿ“‚ Project Structure Simple-Calculator/

โ”‚โ”€โ”€ calculator.py # Main program file

โ”‚โ”€โ”€ README.md # Project documentation

โš™๏ธ How It Works

User enters the first number.

Chooses an operation: +, -, *, /, or ^2.

If an operation requires two numbers, the user is prompted for the second number.

The result is displayed with proper handling of invalid inputs and division by zero.

๐Ÿ’ป Example Run

Enter number: 10

Enter operation(+,-,*,/,^2): *

Enter 2nd number: 5

Answer: 50

Another run with squaring:

Enter number: 7

Enter operation(+,-,*,/,^2): ^2

Answer: 49

๐Ÿ›ก Error Handling

Prevents division by zero

Catches invalid operations and guides the user

๐ŸŽฏ Skills Demonstrated

Python fundamentals (loops, conditionals, operators)

Input handling & validation

Exception handling (ZeroDivisionError)

Writing clean, readable, and structured code

๐Ÿ”ฎ Future Improvements

Add support for power (^) and square root (โˆš)

Implement a menu-driven interface instead of single input prompts

Extend to a GUI version using Tkinter or PyQt

๐Ÿค Contributing

Want to improve this project? Fork the repo, make changes, and submit a pull request!

๐Ÿ“œ License

This project is licensed under the MIT License โ€“ feel free to use and improve it.

About

This is a beginner-friendly Simple Calculator built using Python. It performs basic arithmetic operations like addition, subtraction, multiplication, and division. It's a great project for learning how to take user input and use conditionals to perform different actions based on choices.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages