Python - Letter Count Dict
Write a Python function called LetterCount() which takes a string as an argument and returns a dictionary of letter counts. The line: print LetterCount('Abracadabra, Monsignor')
Solution 1:
You are close. Note that in the task description, the case of the letters is not taken into account. They want {'a': 5}
, where you have {'a': 4, 'A': 1}
.
So you have to convert the string to lower case first (I'm sure you will find out how).
Post a Comment for "Python - Letter Count Dict"