-
Notifications
You must be signed in to change notification settings - Fork 37
/
calculator.py
29 lines (29 loc) · 1017 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
print("===== Welcome to Calculator App =====\n")
while 1:
print("What would you like to do:-")
print("1. Addition")
print("2. Subtraction")
print("3 Multiplication")
print("4. Division")
print("5. Exit")
choice = int(input("Enter your choice: "))
if choice == 1:
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
print("Output: ", num1+num2)
elif choice == 2:
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
print("Output: ", num1-num2)
elif choice == 3:
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
print("Output: ", num1*num2)
elif choice == 4:
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
print("Output: ", num1/num2)
elif choice == 5:
print("Exiting...")
break
print()