Write a Python function that takes a list of words and returns the longest one


Topic: Write a Python function that takes a list of words and returns the longest one

Solution

def find_longest_word(words_list):
word_len = []
for n in words_list:
word_len.append((len(n), n))
word_len.sort()
return word_len[-1][1]
print(find_longest_word(["PHP", "python", "zekelabs"]))



List all Python Programs