Easy Tutorial
❮ Python Func Chr Html Python Os Mkfifo ❯

Python3 List max() Method

Python3 List


Description

The max() method returns the largest value among the elements of the list.

Syntax

Syntax for the max() method:

max(list)

Parameters

Return Value

Returns the largest value among the list elements.

Example

The following example demonstrates the usage of the max() function:

#!/usr/bin/python3

list1, list2 = ['Google', 'tutorialpro', 'Taobao'], [456, 700, 200]

print("list1 largest element value : ", max(list1))
print("list2 largest element value : ", max(list2))

The output of the above example is as follows:

list1 largest element value :  Taobao
list2 largest element value :  700

Python3 List

❮ Python Func Chr Html Python Os Mkfifo ❯