Write a while loop that lets the user enter a number. The number should be multiplied by 10, and the result assigned to a variable named product. The loop should iterate as long as product is less than 100.
#Initialized the variable name
product = 0
#while loop that lets the user enter a number
#The loop should iterate as long as product
#is less than 100.
while product < 100:
number = float(input("Enter a number: "))
#The number should be multiplied by 10,
#and the result assigned to a variable
#named product
product = number * 10
#Display the product
print("The product is:", product)
Executed Output 1:
Enter a number: 4
Enter a number: 3
Enter a number: 5
Enter a number: 2
Enter a number: 33
The product is: 330.0
Executed Output 2:
Enter a number: 5
Enter a number: 2
Enter a number: 5
Enter a number: 2
Enter a number: 2
Enter a number: 2
Enter a number: 1
Enter a number: 1
Enter a number: 9
Enter a number: 10
The product is: 100.0
NOTE: Prompt and read a number from the user. The value of 'product'
exceeds or equals 100, the loop will stop iterating, and print the final value of product.