Create a program that will determine the biggest number among the 3 numbers entered by the user
# Function to find the maximum among three numbers
def find_maximum(a, b, c):
if a >= b and a >= c:
return a
elif b >= a and b >= c:
return b
else:
return c
# Get input from the user
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
num3 = float(input("Enter the third number: "))
# Call the function and store the result
maximum = find_maximum(num1, num2, num3)
# Display the result
print("The largest number among", num1, ",", num2, "and", num3, "is", maximum)
find_maximum
that takes three numbers as input and returns the largest number among them using if-else statements. In the main part of the code, we prompt the user to enter the three numbers, call the find_maximum
function, and then display the result.