longest word in list python code example
Example 1: python longest list in list
def longest(list1):
longest_list = max(len(elem) for elem in list1)
return longest_list
Example 2: python longest word in string
def find_longest_word(word_list):
longest_word = max(word_list, key=len)
return longest_word