Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python min() method

Python min() method

Python Strings Python Strings


Description

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

Syntax

min() method syntax:


min(str)

Parameters

Return Value

Returns the smallest letter in the string.

Example

The following example shows how to use 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:


Min character: !
Min character: !

Python Strings Python Strings