Python Max() Function Example Tutorial
Published On: 07/06/2022 | Category:
Python
Hi Dev,
In this quick example, let's see Python Max() Function With Example . We will use how to find max of an array in python . This article will give you simple example of how to use Python Max() Function With Example? . you'll learn how to find max value in array python . So, let's follow few step to create example of max() function use in python.
Here I will give example for use of max() function using python. So let's see the below example:
Syntax:max (num1, num2, num3, ...)Example : 1
maxNum = max(12,55,17,66,9,99,56) print("The Max Value in List, ",maxNum)Output:
The Max Value in List, 99Example : 2
numList = [45, 56, 151, 777, 456, 123, 756, 989, 102] print("The Max Value in List, ", max(numList))Output:
The Max Value in List, 989Example : 3
color = ['orange', 'pink', 'black', 'red'] print("The Max color is : ", max(color))Output:
The Max color is : redExample : 4
list = [[4, 8], [5, 10], [2, 4],[6,12]] print("The Max Value : ", max(list))Output:
The Max Value : [6, 12]
I Hope It Will Help You....