-
Notifications
You must be signed in to change notification settings - Fork 0
/
Calculator.py
39 lines (33 loc) · 1 KB
/
Calculator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Python Calculator
This is a simple Python calculator program that performs arithmetic operations such as addition, subtraction, multiplication, division, exponentiation, and finding the remainder. It also provides options to terminate the program or reset it.
# Arithmetic Operations
The following arithmetic operations are supported by the calculator:
Addition (+)
Subtraction (-)
Multiplication (*)
Division (/)
Exponentiation (^)
Remainder (%)
# To use the calculator, follow these steps:
Run the program.
Select an operation by entering the corresponding symbol (+, -, *, /, ^, %).
Enter the required numbers when prompted.
The result of the operation will be displayed.
You can terminate the program by entering '#' or reset it by entering '$'.
# Example Usage
Select operation.
1.Add : +
2.Subtract : -
3.Multiply : *
4.Divide : /
5.Power : ^
6.Remainder: %
7.Terminate: #
8.Reset : $
Enter choice(+,-,*,/,^,%,#,$): +
+
Enter first number: 10
10
Enter second number: 5
5
10.0 + 5.0 = 15.0