Write a Python program to count the occurrences of each word in a given sentence


Topic: Write a Python program to count the occurrences of each word in a given sentence

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