1def find_longest_word(word_list):
2 longest_word = max(word_list, key=len)
3 return longest_word
1
2# Longest word
3
4# Reading sentence from user
5
6sentence = input("Enter sentence: ")
7
8# Finding longest word
9longest = max(sentence.split(), key=len)
10
11# Displaying longest word
12print("Longest word is: ", longest)
13print("And its length is: ", len(longest))
14