-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalculator.py
40 lines (30 loc) · 902 Bytes
/
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
39
40
print("*****SIMPLE CALCULATOR*****")
print()
print("Select the operation to be performed :")
print("1. ADD")
print("2. SUBTRACT")
print("3. MULTIPLY")
print("4. DIVIDE")
while(True):
print()
choice = int(input("Enter choice from 1 to 4 : "))
a = int(input("Enter first number : "))
b = int(input("Enter second number : "))
if(choice == 1):
print(f"Result of {a} + {b} = {a+b}")
elif(choice == 2):
print(f"Result of {a} - {b} = {a-b}")
elif(choice == 3):
print(f"Result of {a} x {b} = {a*b}")
elif(choice == 4):
print(f"Result of {a} / {b} = {a/b}")
else:
print("Wrong Choice")
continue
click = (input("Enter 'ac' to end or 'go' to continue : "))
if(click == 'ac'):
break
elif(click == 'go'):
continue
else:
print("Wrong entry")