We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b908d84 commit 84628deCopy full SHA for 84628de
strings/longest_word_in_sentence.py
@@ -13,12 +13,12 @@ def longest_word(sentence: str) -> str:
13
'thousand'
14
>>> longest_word("To be or not to be that is the question")
15
'question'
16
- >>> longest_word("All that glitters is not gold")
17
- 'glitters'
18
>>> longest_word("Beauty is in the eye of the beholder")
19
'beholder'
20
>>> longest_word("A picture is worth a thousand words")
21
+ >>> longest_word("All that glitters is not gold")
+ 'glitters'
22
"""
23
words = sentence.split()
24
return max(words, key=len) if words else ""
0 commit comments