Skip to content

Latest commit

ย 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฎ Python Calculator

A simple command-line calculator built with Python.

This project supports basic arithmetic operations and includes input validation, error handling, and the ability to continue calculations using the previous result.

โœจ Features

  • โž• Addition
  • โž– Subtraction
  • โœ–๏ธ Multiplication
  • โž— Division
  • ๐Ÿ”ข Decimal number support
  • ๐Ÿ›ก๏ธ Input validation
  • โš ๏ธ Division-by-zero protection
  • ๐Ÿ”„ Continue calculations using the previous result
  • ๐Ÿงน Console clearing between sessions
  • โŒ Invalid input handling

๐Ÿ› ๏ธ Built With

  • Python 3
  • Built-in os module

๐Ÿ“‚ Project Structure

python-calculator/
โ”‚
โ””โ”€โ”€ main.py

๐Ÿš€ How to Run

Make sure Python 3 is installed on your system.

Clone the repository:

git clone https://github.com/Ramtinexe/python-calculator.git

Navigate to the project folder:

cd python-calculator

Run the program:

python main.py

๐ŸŽฎ How It Works

  1. Enter the first number.

  2. Choose an operation:

    • + Addition
    • - Subtraction
    • * Multiplication
    • / Division
  3. Enter the second number.

  4. The calculator displays the result.

  5. Choose whether to:

    • Continue calculating with the previous result.
    • Start a new calculation.

๐Ÿ“š What I Learned

This project helped me practice several Python concepts:

  • Functions
  • Return values
  • Dictionaries
  • Dictionary of functions
  • while loops
  • Nested loops
  • if / elif / else
  • break and continue
  • try / except
  • Input validation
  • Error handling
  • Basic file/system operations with os

๐Ÿ‘ค Author

Ramtin

GitHub: https://github.com/Ramtinexe


โญ If you found this project useful, feel free to give it a star!

About

A simple command-line calculator built with Python.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages