top of page
Click here to go to the home page of AskTheCode.

Calculate the +,- ,* and / of two user given no.s using function and return type.

Team ATC

Asked: Anonymously |Category: Python

 

def func(a,b):

add=a+b

sub=a-b

mul=a*b

div=a/b

return (add,sub,mul,div);

a=int(input("Enter the 1st number: "))

b=int(input("Enter the 2nd number: "))

add,sub,mul,div=func(a,b)

print("sum=",add,"substract=",sub,"multiply=",mul,"division=",div)

Recent Posts

See All

Comments


bottom of page