MCPcopy Index your code
hub / github.com/subbarayudu-j/TheAlgorithms-Python / getLetterCount

Function getLetterCount

other/frequency_finder.py:13–22  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

11LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
12
13def getLetterCount(message):
14 letterCount = {'A': 0, 'B': 0, 'C': 0, 'D': 0, 'E': 0, 'F': 0, 'G': 0, 'H': 0,
15 'I': 0, 'J': 0, 'K': 0, 'L': 0, 'M': 0, 'N': 0, 'O': 0, 'P': 0,
16 'Q': 0, 'R': 0, 'S': 0, 'T': 0, 'U': 0, 'V': 0, 'W': 0, 'X': 0,
17 'Y': 0, 'Z': 0}
18 for letter in message.upper():
19 if letter in LETTERS:
20 letterCount[letter] += 1
21
22 return letterCount
23
24def getItemAtIndexZero(x):
25 return x[0]

Callers 1

getFrequencyOrderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected