user=input("Enter the choice(1/2/3/4/5) : ")
print(user)
if user in['1','2','3','4','5']:
num1=float(input("Enter the number: "))
print(num1)
num2=float(input("Enter the number: "))
print(num2)
if user=='1':
print(f"{num1}+{num2}={add(num1,num2)}")
elif user=='2':
print(f"{num1}-{num2}={sub(num1,num2)}")
elif user=='3':
print(f"{num1}*{num2}={mult(num1,num2)}")
elif user=='4':
if num2!=0:
print(f"{num1}/{num2}={div(num1,num2)}")
else:
print("number can't devided by Zero")
elif user=='5':
print(f"{num1} ** {num2}={expol(num1,num2)}")
else:
print("Error in user input")
def add(x,y): return x+y def sub(x,y): return x-y def mult(x,y): return x*y def div(x,y): return x/y def expol(x,y): return x**y def calculator(): print("select the oparation") print("1.add") print("2.sub") print("3.mult") print("4.div") print("5.expol")
calculator()