Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions strings/camel_case_to_snake_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ def camel_to_snake_case(input_str: str) -> str:
>>> camel_to_snake_case("someRandomString")
'some_random_string'
>>> camel_to_snake_case("SomeRandomStr#ng")
'some_random_str_ng'
>>> camel_to_snake_case("SomeRandomString")
'some_random_string'
>>> camel_to_snake_case("123someRandom123String123")
'123_some_random_123_string_123'
Expand Down
4 changes: 4 additions & 0 deletions strings/frequency_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@


def get_letter_count(message: str) -> dict[str, int]:
"""get_letter_count() is a function that takes message as parameter which is
supposed to be the string. and it returns a dictionary where string is a key
and 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 +48,7 @@ def get_letter_count(message: str) -> dict[str, int]:


def get_item_at_index_zero(x: tuple) -> str:
"""It takes x as parameter which is tuple and returns a string."""
return x[0]


Expand Down