Learn about Python Program to Multiply Three Numbers using Function in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.
Contents
Python Program to Multiply Three Numbers using Function
# Python program to multiply three numbers using function
#user-defind function
def product_num(num1, num2, num3):
num = (num1 * num2 * num3)
return num
num1 = float(input('Enter first number: '))
num2 = float(input('Enter second number: '))
num3 = float(input('Enter third number: '))
# function
product = product_num(num1, num2, num3)
# print result
print("The product of number: %0.2f" %product)
Output:
Enter first number: 5 Enter second number: 2 Enter third number: 4 The product of number: 40.00
Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.
Similar Code : Product of Three Numbers in Python using User Input