Python min() Method

Python 字符串Python Strings


Description

The Python min() method returns the smallest letter in the string.

Syntax

The syntax of the min() method is:

min(str)

Parameters

  • str -- String.

Return Value

Returns the smallest letter in the string.

Examples

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

#!/usr/bin/python

str = "this-is-real-string-example....wow!!!";
print "Min character: " + min(str);

str = "this-is-a-string-example....wow!!!";
print "Min character: " + min(str);

The output of the above example is as follows:

Min character: !
Min character: !

Python 字符串Python Strings

Other Extensions