find the longest word in a list python code example
Example 1: how to find the longest string in a list in python
a_list = ["a_string", "the_longest_string", "string"]
longest_string = max(a_list, key=len)
print(longest_string)
Example 2: python longest word in string
def find_longest_word(word_list):
longest_word = max(word_list, key=len)
return longest_word