-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython.py
More file actions
30 lines (30 loc) · 825 Bytes
/
python.py
File metadata and controls
30 lines (30 loc) · 825 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
a=int(input("Enter the first number:"))
b=int(input("Enter second number:"))
n=1
while(n==1):
c=input("Enter the operator(+,-,*,/,**,%):")
if c=='+':
print("Addition :")
print("Sum is",a+b)
elif c=='-':
print("Subtraction :")
print("Difference is",a-b)
elif c=='*':
print("Multiplication :")
print("Product is",a*b)
elif c=='/':
print("Division :")
print("Result is",a/b)
elif c=='**':
print("Square operation :")
print("Square is",a**b)
elif c=='%':
print("Remainder is",a%b)
else:
print("Invalid Operator!!")
s=input("Do you want to continue(y/n):")
if s=='y':
n=1
else:
n=0
print("Exit")