Untitled
def sum(x,y): sum=x+y print("sum of the num is",sum) def diff(x,y): diff=x-y print("difference of the num is is",diff) def mul(x,y): mul=x*y print("multiplication of the num",mul) def div(x,y): div=x/y print("division of the num is",div) x=int(input("enter number1 ")) y=int(input("enter num2 ")) print("enter your choice") print("1 for addition \n2 for substraction \n3 for multiplication\n4 for division") n=int(input("")) if n==1: sum(x,y) elif n==2: diff(x,y) elif n==3: mul(x,y) elif n==4: div(x,y) else: print("\n invalid choice")
Leave a Comment