I'm trying to use Python's pprint
on a dictionary but for some reason it isn't working. Here's my code (I'm using PyCharm Pro as my IDE):`
from pprint import pprint
message = "Come on Eileen!"
count = {}
for character in message:
count.setdefault(character, 0)
count[character] += 1
pprint(count)
And here's my output:
{' ': 2, '!': 1, 'C': 1, 'E': 1, 'e': 3, 'i': 1, 'l': 1, 'm': 1, 'n': 2, 'o': 2}
Any help with this would be appreciated.