I want to count occurrence of all letters in a word using dictionary. So far I've tried adding to dict in for loop.
I wonder is it possible to use dictionary comprehensions?
word = "aabcd"
occurrence = {}
for l in word.lower():
if l in occurrence:
occurrence[l] += 1
else:
occurrence[l] = 1