Python字符串 |分钟()
min()是Python编程语言中的一个内置函数,它返回字符串中的最小字母字符。
句法:
min(string)
范围:
min() 方法接受一个字符串作为参数
返回值:
Returns a character which is alphabetically the lowest character in the string.
下面是方法min()的Python实现
# python program to demonstrate the use of
# min() function
# minimum alphabetical character in
# "geeks"
string = "geeks"
print(min(string))
# minimum alphabetical character in
# "raj"
string = "raj"
print(min(string))
输出:
e
a