Python max() built-in function

From the Python 3 documentation

Return the largest item in an iterable or the largest of two or more arguments.

Introduction

The max() function can be used in two ways:

  1. With an iterable (like a list or tuple), it returns the largest item.
  2. With two or more arguments, it returns the largest of them.

Examples

Finding the max in an iterable:

numbers = [1, 2, 10, 40, 5]
print(max(numbers))

letters = ('a', 'b', 'z')
print(max(letters))
40
z

Finding the max of several arguments:

print(max(10, 20, 5))
20