Hi CodeCademy community, I’m having a hard time understanding the solution here, specifically
and not (letter in common):
Here’s the full solution code:
def common_letters(string_one, string_two): common =  for letter in string_one: if (letter in string_two) and not (letter in common): common.append(letter) print(common) return common common_letters("manhattan", "san francisco")
The way I read this is that we create an empty list to house all our similar letters, then we start a for loop in string_one looking through each letter and starting an if then statement where we check if the “letter” from string_one was in string_two, but not in our newly created empty list.
Am I reading that correctly? Why is the “not” statement crucial to running this code?