Home >Backend Development >Python Tutorial >python iterate over longest word in output list
python traverses the longest word in the output list
Specific code:
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 = []
Recommended tutorial:python tutorial
The above is the detailed content of python iterate over longest word in output list. For more information, please follow other related articles on the PHP Chinese website!