Skip to content

It is Python based Basic Calculator which uses topics like loops, exceptional handling and mathematical operations to calculate the result.

Notifications You must be signed in to change notification settings

zoyaruhail/Basic_calculator_using_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Basic_calculator_using_Python

It is Python based Basic Calculator which uses topics like loops, exceptional handling and mathematical operations to calculate the result.

#Overview

This is a simple command-line calculator that allows users to perform basic mathematical operations:

Addition

Subtraction

Multiplication

Division

Exit

The program runs in a continuous loop, allowing users to perform multiple calculations until they choose to exit.

#How the Calculator Works

User Menu

The program starts by displaying a menu with available operations. The user selects an operation by entering a number (1-5). Mathematical Operations

Based on the user’s choice, the program asks for input numbers. It performs the selected operation and displays the result. Users can continue adding, subtracting, multiplying, or dividing more numbers if they choose. Error Handling

Zero Division Error: If the user tries to divide by zero, the program displays a warning. Value Error: If the user enters invalid (non-numeric) input, the program displays an error message. Looping Feature

After performing an operation, the program asks if the user wants to continue with the same operation. The program continues until the user selects Exit (5). Exit Condition

If the user selects option 5, the program thanks them and terminates.

#Features

✅ Supports Addition, Subtraction, Multiplication, and Division

✅ Allows continuous calculations without restarting

✅ Prevents division by zero

✅ Handles invalid inputs gracefully

✅ User-friendly interface

#How to Run the Calculator

Ensure Python is installed on your system.

Copy and paste the code into a new Python file (e.g., calculator.py).

Open a terminal or command prompt and run:

python basic_calculator.py

follow the on-screen instructions to perform calculations.

About

It is Python based Basic Calculator which uses topics like loops, exceptional handling and mathematical operations to calculate the result.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages