From f815dff2018a313f471ced6e4fa8cdb0e17fca50 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:22:35 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- strings/largest_smallest_words.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/strings/largest_smallest_words.py b/strings/largest_smallest_words.py index ac0656c7a..39272bd16 100644 --- a/strings/largest_smallest_words.py +++ b/strings/largest_smallest_words.py @@ -1,13 +1,14 @@ -""" +""" To find the smallest and largest word in the sentence -Example - if the input string is +Example + if the input string is My name is abc then the output will be The smallest word in the given string is be The largest word in the given string is output """ + def find_smallest_and_largest_words(input_string): words = input_string.split() if not words: @@ -18,6 +19,7 @@ def find_smallest_and_largest_words(input_string): return smallest_word, largest_word + if __name__ == "__main__": input_string = input("Enter a string here:\n").strip() smallest, largest = find_smallest_and_largest_words(input_string)