Skip to content

sankalpsatpute/Calculator-using-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 

Repository files navigation

Calculator-using-python

๐Ÿงฎ 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.

โ–ถ๏ธ How to Run

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

4] Follow the on-screen instructions.

Made with Love by Sankalp Satpute

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages