So in my studies I have been asked to
Write a function called
common_lettersthat takes two arguments,
string_twoand then returns a list with all of the letters they have in common.
The letters in the returned list should be unique. For example,
I wrote a function:
def common_letters(string_one,string_two): lst =  for character in string_one: if (character in string_two): lst.append(character) return lst common_letters("Shlomi","Samson")
And I got an empty list.
However, when looking at the solution I’ve noticed that they added -
and not (character in lst):
I don’t ever recall coming across “and not” in my studies, what is it exactly and why did I had to add it?