Codecademy Forums

FAQ: Code Challenge: String Methods - Count Letters

Okay, so we wish to return 4 from mississippi. The word unique is ambiguous in this context since only the m is unique, the rest are similar, but make up the other three distinct letters.

As for the letters string, that’s as much as saying, letter.isalpha() to prevent non-alpha characters from being included in the count. Not sure, but I think the only other place we see isalpha() is in the Pyg Latin exercise.

what%20am%20i%20doing%20wrong

I’ve seen the solution but still having no idea why my code doesn’t work.
Could someone points out what’s wrong with my code?

Your solution creates a list of completely unique letters but that does not tell us if it is unique in the source in the source string. For that we need to verify its count.

if word.count(i) == 1: