Python max() function

Python max() function

The max() function in Python returns the largest item in an iterable or the largest of two or more arguments.

Syntax

 

Parameter

arg1, arg2, *args: This parameter represents one or more items to compare

Or

iterable:  It represents an iterable, with one or more items to compare

Return

This function returns the item with the highest value or the item with the highest value in an iterable.

Example 1

Output

Example 2

Output