📌  相关文章
📜  如何在列表中找到最短的单词python代码示例

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

代码示例2
def findShortest(lst):
    length = len(lst)
    short = len(lst[0])
    ret = 0
    for x in range(1, length):
        if len(lst[x]) < short:
            short = lst[x]
            ret = x

    return x # return the index of the shortest sentence in the list