Python program to find largest of 3 numbers : The python is very easy to find the minimum, maximum elements and, position. It will provide the inbuilt functions as the min (), max () and max is used to find out the maximum values in the array. The max() method will return the largest element or largest element of two or more parameters. The program explanation to find out the largest number between two numbers. We can use the same method for the floating-point numbers in the python programming to find out the largest number among the three numbers.
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)
Output:-
Enter first number: 10
Enter first number: 15
Enter first number: 22
The largest number is 2
Steps:-
Example:-
defmaximum (a, b, c):
list= [a, b, c]
return max (list)
a=10
b=14
c=12
print (maximum (a, b, c))
Output:-
14