MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / get_letter_count

Function get_letter_count

strings/frequency_finder.py:38–44  ·  view source on GitHub ↗
(message: str)

Source from the content-addressed store, hash-verified

36
37
38def get_letter_count(message: str) -> dict[str, int]:
39 letter_count = dict.fromkeys(string.ascii_uppercase, 0)
40 for letter in message.upper():
41 if letter in LETTERS:
42 letter_count[letter] += 1
43
44 return letter_count
45
46
47def get_item_at_index_zero(x: tuple) -> str:

Callers 1

get_frequency_orderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected