Skip to content

Commit cbe3204

Browse files
vivek2004-secpre-commit-ci[bot]cclauss
authored
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>
1 parent 5bd6b19 commit cbe3204

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

strings/frequency_finder.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737

3838
def get_letter_count(message: str) -> dict[str, int]:
39+
"""get_letter_count() takes message as a parameter, which should be a string.
40+
It returns a dictionary where the string is a key and an integer is a value."""
3941
letter_count = dict.fromkeys(string.ascii_uppercase, 0)
4042
for letter in message.upper():
4143
if letter in LETTERS:
@@ -45,6 +47,7 @@ def get_letter_count(message: str) -> dict[str, int]:
4547

4648

4749
def get_item_at_index_zero(x: tuple) -> str:
50+
"""Take a tuple x as a parameter and return a string."""
4851
return x[0]
4952

5053

0 commit comments

Comments
 (0)