Longest Word
Completed
Read a sentence and print its longest word. If several words share the longest length, print the first one.
Input
One line of words.
Output
The longest word.
Example
Input
the quick brown fox jumps
Output
quick
Editor
Python
Hints
max() accepts a key function.
key=len compares words by their length.
Solution explanation
max(items, key=len) returns the item with the largest len; ties keep the first one found.
Show solution
words = input().split()
print(max(words, key=len))