max function

Syntax

  • float max(a, b)

Parameters

  1. a—(float, string)
  2. b—(float, string)
    Must have the same type as a.

Returns

Returns maximum of a and b.

Description

The max function finds the maximum of a and b. It also works if a and b are strings.

Related

Examples

max(10, -10)
# result = 10
max("abc", "def")
# result = "def"

In this topic