To find the maximum of three numbers in Python, the easiest way is to use the Python max() function.
a = 5
b = 10
c = 15
print(max(a,b,c))
#Output
15
If you have the three numbers in a list, you can pass the list to max() and get the maximum value.
If you have the three numbers in a list, you can pass the list to max() and get the maximum value.
To get the maximum value of a list of numbers in Python, we use the max() function.
list_of_numbers = [10,32,98,38,47,34]
print(max(list_of_numbers))
#Output
98
Hopefully this article has been useful for you to learn how to use the Python max() function to get the maximum of three numbers.
Leave a Reply