Write a definition of a function called product. The functionreceives two parameters containing integer values. You may assumethat neither parameter is negative. The function returns theproduct of the parameters. So, product(3,5) returns 15. Thefunction must not use a loop of any kind (for, while,do-while).
This is what I had, but it said there was an executionerror.
def product(x,y):
return (x *y)
a = int(input(“Enter first postive number:”))
b = int(input(“Enter second postive number:”))
print(product(a,b))
Solution
CODE:
def product(x,y):
return(x*y)
a=int(input(“Enter First positive Number:”))
b=int(input(“Enter Second Positive Number:”))
product(a,b)
print(product(a,b))
SCREENSHOT OFTHE PROGRAM:
OUTPUT:
product.py
OR
OR