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.


There are many powerful built-in functions in the Python language which allow us to perform basic or complex tasks easily.

One such task is to find the maximum value of a collection of numbers.

You can find the maximum of three numbers with the Python max() function.

The Python max() function allows us to find the maximum, or biggest, value in an iterable (list, dictionary, set, etc.) made up of numbers or strings.

Below is an example of how you can use max() to find the maximum of three numbers in Python.

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 instead want to find the minimum value of three numbers, you can use the Python min() function.

How to Find Biggest Value in List of Numbers Using Python max() Function

If you have more than three numbers, or you have a list of numbers, you can also use max().

You can use the Python max() function to get the biggest value in a list of numbers easily. To find the max value of a list, we just pass the list to max().

Let's say we have the following list of numbers.

list_of_numbers = [10,32,98,38,47,34]

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.

Categorized in:

Python,

Last Update: March 22, 2024