Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions strings/frequency_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@


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:
Expand All @@ -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]


Expand Down
Loading