a_list = ["a_string", "the_longest_string", "string"]
longest_string = max(a_list, key=len)
print(longest_string)
def longest(list1):
longest_list = max(len(elem) for elem in list1)
return longest_list
words = ['hello','sample,'word','about','hey','longes','mikeys']
# the code:
longestWord = max(words,key=len) # will get the longest word
length = len(longestWord) # will get the length of the longest word
long_word = [i for i in words if len(i) == length] # list comprehension thatt will get all the longest word in the list