def add(a,b):
total=a+b
print(total)
def sub(a,b):
total=a-b
print(total)
def mul(a,b):
total=a*b
print(total)
def div(a,b):
total=a/b
print(total)
print('press 1 addition')
print('press 2 subtraction')
print('Press 3 Multiplication')
print('press 4 division')
x=int(input("Press number :"))
if x==1:
no1=int(input("Enter value no1:"))
no2=int(input("Enter value no2 :"))
add(no1,no2)
elif x==2:
no1=int(input("Enter value no1 :"))
no2=int(input("Enter value no2 :"))
sub(no1,no2)
elif x==3:
no1=int(input("Enter value no1 :"))
no2=int(input("Enter value no2 :"))
mul(no1,no2)
elif x==4:
no1=int(input("Enter value no1 :"))
no2=int(input("Enter value no2 :"))
div(no1,no2)
else:
print('Error')
Tags
PYTHON
-