You can download this code by clicking the button below.
This code is now available for download.
Find the longest word in the given text.
Technology Stack : Python built-in libraries (str.split(), str.max(), len())
Code Type : String processing
Code Difficulty : Intermediate
def get_longest_word(text):
words = text.split()
longest_word = max(words, key=len)
return longest_word