From ec77a4819cc27b55d96aa5f809162ed506ece25a Mon Sep 17 00:00:00 2001 From: BethanyG Date: Mon, 11 May 2026 13:07:44 -0700 Subject: [PATCH] Updated exemplar and stub docstrigs to use Google style. --- .../little-sisters-essay/.meta/exemplar.py | 32 +++++++++++------ .../little-sisters-essay/string_methods.py | 34 +++++++++++++------ 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/exercises/concept/little-sisters-essay/.meta/exemplar.py b/exercises/concept/little-sisters-essay/.meta/exemplar.py index c51e930d820..f62fff90c30 100644 --- a/exercises/concept/little-sisters-essay/.meta/exemplar.py +++ b/exercises/concept/little-sisters-essay/.meta/exemplar.py @@ -4,8 +4,11 @@ def capitalize_title(title): """Convert the first letter of each word in the title to uppercase if needed. - :param title: str - title string that needs title casing. - :return: str - title string in title case (first letters capitalized). + Parameters: + title (str): Essay title that needs title casing. + + Returns: + str: The title string in title case (first letters capitalized). """ return title.title() @@ -14,8 +17,11 @@ def capitalize_title(title): def check_sentence_ending(sentence): """Check the ending of the sentence to verify that a period is present. - :param sentence: str - a sentence to check. - :return: bool - is the sentence punctuated correctly? + Parameters: + sentence (str): A sentence to check. + + Returns: + bool: Is the sentence punctuated correctly? """ return sentence.endswith(".") @@ -24,8 +30,11 @@ def check_sentence_ending(sentence): def clean_up_spacing(sentence): """Trim any leading or trailing whitespace from the sentence. - :param sentence: str - a sentence to clean of leading and trailing space characters. - :return: str - a sentence that has been cleaned of leading and trailing space characters. + Parameters: + sentence (str): A sentence to clean of leading and trailing space characters. + + Returns: + str: A sentence that has been cleaned of leading and trailing space characters. """ clean_sentence = sentence.strip() @@ -35,10 +44,13 @@ def clean_up_spacing(sentence): def replace_word_choice(sentence, old_word, new_word): """Replace a word in the provided sentence with a new one. - :param sentence: str - a sentence to replace words in. - :param old_word: str - word to replace. - :param new_word: str - replacement word. - :return: str - input sentence with new words in place of old words. + Parameters: + sentence (str): A sentence to replace words in. + old_word (str): The word to replace. + new_word (str): The replacement word. + + Returns: + str: Input sentence with new words in place of old words. """ better_sentence = sentence.replace(old_word, new_word) diff --git a/exercises/concept/little-sisters-essay/string_methods.py b/exercises/concept/little-sisters-essay/string_methods.py index 5c5b9ce66dd..080dc8ec95c 100644 --- a/exercises/concept/little-sisters-essay/string_methods.py +++ b/exercises/concept/little-sisters-essay/string_methods.py @@ -4,8 +4,11 @@ def capitalize_title(title): """Convert the first letter of each word in the title to uppercase if needed. - :param title: str - title string that needs title casing. - :return: str - title string in title case (first letters capitalized). + Parameters: + title (str): Essay title that needs title casing. + + Returns: + str: The title string in title case (first letters capitalized). """ pass @@ -14,18 +17,24 @@ def capitalize_title(title): def check_sentence_ending(sentence): """Check the ending of the sentence to verify that a period is present. - :param sentence: str - a sentence to check. - :return: bool - return True if punctuated correctly with period, False otherwise. + Parameters: + sentence (str): A sentence to check. + + Returns: + bool: Is the sentence punctuated correctly? """ pass def clean_up_spacing(sentence): - """Verify that there isn't any whitespace at the start and end of the sentence. + """Trim any leading or trailing whitespace from the sentence. - :param sentence: str - a sentence to clean of leading and trailing space characters. - :return: str - a sentence that has been cleaned of leading and trailing space characters. + Parameters: + sentence (str): A sentence to clean of leading and trailing space characters. + + Returns: + str: A sentence that has been cleaned of leading and trailing space characters. """ pass @@ -34,10 +43,13 @@ def clean_up_spacing(sentence): def replace_word_choice(sentence, old_word, new_word): """Replace a word in the provided sentence with a new one. - :param sentence: str - a sentence to replace words in. - :param old_word: str - word to replace. - :param new_word: str - replacement word. - :return: str - input sentence with new words in place of old words. + Parameters: + sentence (str): A sentence to replace words in. + old_word (str): The word to replace. + new_word (str): The replacement word. + + Returns: + str: Input sentence with new words in place of old words. """ pass