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

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)

6 views

Recent Posts

See All

"Believe you can and you're halfway there"