And Not?

Hello Everyone,
So in my studies I have been asked to

Write a function called common_letters that takes two arguments, string_one and string_two and then returns a list with all of the letters they have in common.

The letters in the returned list should be unique. For example,

common_letters("banana", "cream")

should return ['a'] .

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?

We only want a list of unique letters common to both strings. That means before appending it is necessary to check if the character is already a member of the uniques list, and ignore if it is.

A and not B

If A is a non-zero numeral, and B is a numeral, B must be zero for this to be True.

If A is zero, the outcome will be False regardless what B is.

NOT is a simple operator. It will coerce its operand to a boolean based upon its truth value, and then it negates that. True becomes False, False becomes True.