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

来自:互联网
时间:2020-05-10
阅读:

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 = []
返回顶部
顶部