python | February 13, 2020
def find_longest_word(words):
for index in range(len(words)-1):
if len(words[index]) > len(words[index+1]):
longest_word = words[index]
else:
longest_word = words[index+1]
return longest_word
#model solution
def find_longest_word(words):
word_len = []
for n in words:
word_len.append((len(n), n))
word_len.sort()
return word_len[-1][1]
list_name.sort() #오름차순
list_name.sort(reverse=True) #내림차순