QUESTION IMAGE
Question
write a python program that prompts the user to enter three numbers and checks which number is the smallest. print out an appropriate message depending on the input.
Step1: Get user input
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
num3 = float(input("Enter the third number: "))
Step2: Compare numbers and find smallest
smallest = num1
if num2 < smallest:
smallest = num2
if num3 < smallest:
smallest = num3
Step3: Print message
print(f"The smallest number is {smallest}")Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
num3 = float(input("Enter the third number: "))
smallest = num1
if num2 < smallest:
smallest = num2
if num3 < smallest:
smallest = num3
print(f"The smallest number is {smallest}")