163k views
3 votes
Take three numbers as input from the user. Store these numbers in a list. Display their product on the screen

User Miscreant
by
7.6k points

1 Answer

2 votes

This is how we will take three numbers as input from a user and store them in a list, and at the end, display their product as output with Python

Code :

# Ask the user for three numbers

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

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

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

# Store the numbers in a list

num_list = [num1, num2, num3]

# Calculate the product of the numbers

product = num_list[0] * num_list[1] * num_list[2]

# Display the product on the screen

print("The product of", num_list, "is", product)

User Pof
by
7.4k points