📜  最短单词长度的程序 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:08.658000             🧑  作者: Mango

代码示例1
def find_short(s):
    min_length = float("inf")

    for x in s.split():
        if len(x) < min_length:
            min_length = len(x)

    return min_length