MCPcopy Create free account
hub / github.com/geekcomputers/Python / count_chars

Function count_chars

CountMillionCharacters-Variations/variation1.py:7–15  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

5
6
7def count_chars(filename):
8 count = {}
9
10 with open(filename) as info: # inputFile Replaced with filename
11 readfile = info.read()
12 for character in readfile.upper():
13 count[character] = count.get(character, 0) + 1
14
15 return count
16
17
18def main():

Callers 1

mainFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected