def countLetters(word): letterdict = {} for letter in word: letterdict[letter] = letterdict.get(letter, 0) + 1 return letterdict
No comments:
Post a Comment