Skip to content

Commit 84628de

Browse files
authored
Update longest_word_in_sentence.py
1 parent b908d84 commit 84628de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

strings/longest_word_in_sentence.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ def longest_word(sentence: str) -> str:
1313
'thousand'
1414
>>> longest_word("To be or not to be that is the question")
1515
'question'
16-
>>> longest_word("All that glitters is not gold")
17-
'glitters'
1816
>>> longest_word("Beauty is in the eye of the beholder")
1917
'beholder'
2018
>>> longest_word("A picture is worth a thousand words")
2119
'thousand'
20+
>>> longest_word("All that glitters is not gold")
21+
'glitters'
2222
"""
2323
words = sentence.split()
2424
return max(words, key=len) if words else ""

0 commit comments

Comments
 (0)