Exercise
Utilizing {0} And Adding Comments
Objective
Develop a Python program that prompts the user to input three numbers and then displays their product. The first line should be a comment with your name and surname. It MUST look as follows:
# Your Name and Surname
Enter the first number to multiply:
12
Enter the second number to multiply:
23
Enter the third number to multiply:
2
Example Python Exercise
Show Python Code
# Prompt the user to enter the first number
num1 = float(input("Enter the first number to multiply: "))
# Prompt the user to enter the second number
num2 = float(input("Enter the second number to multiply: "))
# Prompt the user to enter the third number
num3 = float(input("Enter the third number to multiply: "))
# Calculate the product of the three numbers
product = num1 * num2 * num3
# Display the result
print(f"The product of {num1}, {num2}, and {num3} is {product}")
Output
Enter the first number to multiply:
12
Enter the second number to multiply:
23
Enter the third number to multiply:
2
The product of 12.0, 23.0, and 2.0 is 552.0
Share this Python Exercise