-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCalculator.py
More file actions
30 lines (20 loc) · 952 Bytes
/
Calculator.py
File metadata and controls
30 lines (20 loc) · 952 Bytes
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
i=int(input("Enter no i:"))
j=int(input("Enter no j:"))
ch=input("Enter 1 for addition: \nEnter 2 for substraction: \nEnter 3 for Multiplication: \nEnter 4 for division: \nEnter 5 for Modulus: \nEnter 6 for Exponent: \nEnter 7 for floor division:) ")
ch=int(ch)
if ch==1 :
print("Addition of",i,"and",j,"is :", i+j)
elif ch==2 :
print("Substraction of",i,"and",j,"is:", i-j)
elif ch==3 :
print("Multiplication of",i,"and",j,"is:", i*j)
elif ch==4 :
print("Division of",i,"and",j,"is:",i/j)
elif ch==5 :
print("Modulus of",i,"and",j,"is:",i%j)
elif ch==6 :
print("Exponential of",i,"and",j,"is:",i**j)
elif ch==7 :
print("Floor Division of",i,"and",j,"is:",i//j)
else :
print("wrong choice")