From cbe32049269f76a3db5f0489780ca77392b64c15 Mon Sep 17 00:00:00 2001 From: Vivek Kamble Date: Wed, 16 Sep 2026 22:52:59 +0530 Subject: [PATCH] Add docstring frequency finder (#14833) * corrected the typos * added the docstrings in the functions * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update camel_case_to_snake_case.py * Improve docstring clarity in frequency_finder.py Updated docstrings for get_letter_count and get_item_at_index_zero functions for clarity. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss --- strings/frequency_finder.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/strings/frequency_finder.py b/strings/frequency_finder.py index 98720dc36..2041fe50d 100644 --- a/strings/frequency_finder.py +++ b/strings/frequency_finder.py @@ -36,6 +36,8 @@ LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" def get_letter_count(message: str) -> dict[str, int]: + """get_letter_count() takes message as a parameter, which should be a string. + It returns a dictionary where the string is a key and an integer is a value.""" letter_count = dict.fromkeys(string.ascii_uppercase, 0) for letter in message.upper(): if letter in LETTERS: @@ -45,6 +47,7 @@ def get_letter_count(message: str) -> dict[str, int]: def get_item_at_index_zero(x: tuple) -> str: + """Take a tuple x as a parameter and return a string.""" return x[0]