Name

max()

Examples
a = max(5, 9)  # Sets 'a' to 9
b = max(-4, -12)  # Sets 'b' to -4
c = max(12.3, 230.24)  # Sets 'c' to 230.24
values = 9, -4, 362, 21  # Create an array of ints
d = max(values)  # Sets 'd' to 362
Description Determines the largest value in a sequence of numbers, and then returns that value. max() accepts either two or three float or int values as parameters, or an array of any length.
Syntax
 
max(a, b)
max(a, b, c)
max(list)
Parameters
afloat, or int: first number to compare
bfloat, or int: second number to compare
cfloat, or int: third number to compare
listfloat, or int: list of numbers to compare
Related min()

Updated on Tue Feb 27 14:07:12 2024.

If you see any errors or have comments, please let us know.