好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

python遍历输出列表中最长的单词

python遍历输出列表中最长的单词

具体代码:

word_len_list = [len(word) for word in list]
max_word_len = max(word_len_list)
for word in list:
    if len(word) == max_word_len:
            #print(word)
        list = []

推荐教程:python教程

以上就是python遍历输出列表中最长的单词的详细内容,更多请关注Gxlcms其它相关文章!

查看更多关于python遍历输出列表中最长的单词的详细内容...

  阅读:44次