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 <cclauss@me.com>
This commit is contained in:
Vivek Kamble
2026-09-16 19:22:59 +02:00
committed by GitHub
co-authored by pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Christian Clauss
parent 5bd6b19c16
commit cbe3204926
+3
View File
@@ -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]