-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculator.py
30 lines (28 loc) · 904 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
print("Welcome to Calculator Project")
print("1. Addittion")
print("2. Subtraction")
print("3. Multiplication")
print("4. Division")
option = int(input("Select an option for Basic Calculator Operation: "))
if option == 1:
n1 = int(input ("Enter 1st number: "))
n2 = int(input ("Enter 2nd number: "))
n3 = n1 + n2
print("Addition is: "+ str(n3))
elif option == 2:
n1 = int(input ("Enter 1st number: "))
n2 = int(input ("Enter 2nd number: "))
n3 = n1 - n2
print("Subtraction is: "+ str(n3))
elif option == 3:
n1 = int(input ("Enter 1st number: "))
n2 = int(input ("Enter 2nd number: "))
n3 = n1 * n2
print("Multiplication is: "+ str(n3))
elif option == 4:
n1 = int(input ("Enter 1st number: "))
n2 = int(input ("Enter 2nd number: "))
n3 = n1 / n2
print("Division is: "+ str(n3))
else:
print("Invalid Input")