🧮
Simple Calculator
This Python script is a simple calculator that allows for basic arithmetic operations such as addition, subtraction, multiplication, division, and…
This Python script is a simple calculator that allows for basic arithmetic operations such as addition, subtraction, multiplication, division, and…
This Python script is a simple calculator that allows for basic arithmetic operations such as addition, subtraction, multiplication, division, and average calculation. It takes user input to perform the desired operation and displays the result.
Enter '1' for addition
Enter '2' for subtraction
Enter '3' for multiplication
Enter '4' for division
Enter '5' for average
...
Enter '-1' to exit.
Your choice is: 1
Enter all numbers separated by space: 4 8 15 16
The answer is 43
Your choice is: 4
Enter first number: 20
Enter second number: 8
The answer is 2.5
Your choice is: -1
Thank you for using the calculator!
Run the script:
python main.py
Follow the prompts to choose an operation and input the required numbers.
View the result of the selected operation.
1): Sum of multiple numbers.2): Difference between two numbers.3): Product of multiple numbers.4): Quotient of two numbers.5): Average of multiple numbers.To exit the calculator, enter -1 when prompted for your choice.
This calculator clears the console after each operation for a better user experience.