This is my solution resulting in an error. Returns 0
PS: I\'d still love a fix to my code :)
from collections import Counter import
def count_letters(word): return len(word) - word.count(' ')
Alternatively, if you have multiple letters to ignore, you could filter the string:
def count_letters(word): BAD_LETTERS = " " return len([letter for letter in word if letter not in BAD_LETTERS])