-
Notifications
You must be signed in to change notification settings - Fork 2
/
Simple_Calculator.py
59 lines (47 loc) · 2.08 KB
/
Simple_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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
def Simple_Calculator():
flag = True
while flag:
print("1.Addition")
print("2.Subtraction")
print("3.Multiplication")
print("4.Division")
print("5.Modulus")
print("6.Exponential")
print("7.Floor Division")
print("8.EXIT")
User_Choice = int(input("Select The Operation You Want To Perfrom: "))
if User_Choice == 1:
num1 = int(input("Enter The First Number: "))
num2 = int(input("Enter The Second Number: "))
print("The Addition Result Is:",(num1+num2))
elif User_Choice == 2:
num1 = int(input("Enter The First Number: "))
num2 = int(input("Enter The Second Number: "))
print("The Subtraction Result Is:",(num1-num2))
elif User_Choice == 3:
num1 = int(input("Enter The First Number: "))
num2 = int(input("Enter The Second Number: "))
print("The Multiplication Result Is:",(num1*num2))
elif User_Choice == 4:
num1 = int(input("Enter The First Number: "))
num2 = int(input("Enter The Second Number: "))
print("The Division Result Is:",(num1/num2))
elif User_Choice == 5:
num1 = int(input("Enter The First Number: "))
num2 = int(input("Enter The Second Number: "))
print("The Modulus Result Is:",(num1%num2))
elif User_Choice == 6:
num1 = int(input("Enter The First Number: "))
num2 = int(input("Enter The Second Number: "))
print("The Exponential Result Is:",(num1**num2))
elif User_Choice == 7:
num1 = int(input("Enter The First Number: "))
num2 = int(input("Enter The Second Number: "))
print("The Floor Division Result Is:",(num1/num2))
elif User_Choice == 8:
print("Exiting...........")
flag = False
else:
print("Invalid Choice..........")
flag = False
Simple_Calculator()