Python3 max() Method

Python3 字符串Python3 Strings


Description

The max() method returns the largest letter in the string.

Syntax

Syntax of the max() method:

max(str)

Parameters

  • str -- String.

Return Value

Returns the largest letter in the string.

Examples

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

#!/usr/bin/python3

str = "example"
print ("最大字符: " + max(str))

The output of the above example is:

最大字符: u

Python3 字符串Python3 Strings

Other Extensions