The first line will contain a message prompt to input the first number.
The second line will contain a message prompt to input the second number.
The third line will contain a message prompt to input the third number.
The last line will contain the largest among the three numbers.
Enter·the·first·number:·1
Enter·the·second·number:·2
Enter·the·third·number:·3
The·largest·number·is·3
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
num3 = float(input("Enter third number: "))
if (num1 > num2) and (num1 > num3):
largest = num1
elif (num2 > num1) and (num2 > num3):
largest = num2
else:
largest = num3
print("The largest number is",largest)
Comments
Leave a comment