200k views
3 votes
Write a function named print_product that accepts three numbers as parameters and prints the product. First, write the print_product function. Then, prompt the user for three inputs, and call your print_product function on those inputs.

User Ali Asad
by
5.1k points

1 Answer

4 votes

def print_product(num1, num2, num3):

product = num1 * num2 * num3

print(f"The product of {num1}, {num2}, and {num3} is {product}.")

# Prompt the user for three inputs

num1 = int(input("Enter the first number: "))

num2 = int(input("Enter the second number: "))

num3 = int(input("Enter the third number: "))

# Call the print_product function on the user's inputs

print_product(num1, num2, num3)

User Macbeth
by
4.9k points