From 84628de8dcdcae0601ef6c2c714138a40aa54250 Mon Sep 17 00:00:00 2001 From: Saurabh Mahapatra <98408932+its-100rabh@users.noreply.github.com> Date: Thu, 11 Jul 2024 21:53:51 +0530 Subject: [PATCH] Update longest_word_in_sentence.py --- strings/longest_word_in_sentence.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strings/longest_word_in_sentence.py b/strings/longest_word_in_sentence.py index 4389236d8..addfa860e 100644 --- a/strings/longest_word_in_sentence.py +++ b/strings/longest_word_in_sentence.py @@ -13,12 +13,12 @@ def longest_word(sentence: str) -> str: 'thousand' >>> longest_word("To be or not to be that is the question") 'question' - >>> longest_word("All that glitters is not gold") - 'glitters' >>> longest_word("Beauty is in the eye of the beholder") 'beholder' >>> longest_word("A picture is worth a thousand words") 'thousand' + >>> longest_word("All that glitters is not gold") + 'glitters' """ words = sentence.split() return max(words, key=len) if words else ""