TUTORIALProgrammingFETCHED

Python3 min()方法

Python3 min()方法 Python3 字符串 描述 Python min() 方法返回字符串中最小的字母。 语法 min()方法语法: min(str) 参数 str -- 字符串。 返回值 返回字符串中最小的字母。 实例 以下实例展示了min()函数的使用方法: 实例 [mycode4 type='python'] #!/usr/bin/python3 str = 'runo..

Updated 7/16/2026

Tutorial detail pages default to noindex.

Python3 min()方法

Python3 字符串 Python3 字符串


描述

Python min() 方法返回字符串中最小的字母。

语法

min()方法语法:

min(str)

参数

  • str -- 字符串。

返回值

返回字符串中最小的字母。

实例

以下实例展示了min()函数的使用方法:

实例

#!/usr/bin/python3

str = "runoob";
print ("最小字符: " + min(str));

以上实例输出结果如下:

最小字符: b

Python3 字符串 Python3 字符串