๐งฎ Python Calculator
This is a simple Command Line Interface (CLI) Calculator built in Python. The calculator supports basic arithmetic operations such as addition (+), subtraction (-), multiplication (*), and division (/).
It also includes error handling, loops, and user interaction for a smooth experience.
๐ Features
1] User-friendly interaction: Greets user by name.
2] Arithmetic operations: Addition, Subtraction, Multiplication, and Division.
3] Error Handling:
-Handles invalid number inputs.
-Prevents division by zero.
4] Loops: Runs continuously until the user chooses to exit.
5] Exit Option: Option to continue (y) or exit (n) after each calculation.
๐ ๏ธ Concepts Used
1] Functions โ Code is wrapped in a function for modularity.
2] Loops (while True) โ Keeps the calculator running until explicitly exited.
3] Conditionals (if/elif/else) โ Checks operator and performs respective operation.
4] Exception Handling (try/except) โ Catches invalid input errors.
5] String Formatting (f-strings) โ Provides clean, readable output.
6] Exit Control โ User can terminate program by entering n.
1] Save the file as calculator.py.
2] Open terminal or command prompt in the same directory.
3] Run the program using:
python calculator.py
Made with Love by Sankalp Satpute