>>4920
for x in a and x in b:
This construct does not exist in Python. "and" is nothing more than a boolean operator. If you wanted to iterate over both, you need nested loops (which the "in" and "not in" operators would essentially achieve for you). The other poster is right about sets, but remember that python sets have special semantics that can make this kind of use more intuitive:
a = {1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89}
b = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}
nlista = a & b
print(nlista)
Or, if "a" and "b" have to be given to you as lists, you can do what >>4923 did, but using the special operators and casting:
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
lista = set(a) & set(b)
print(lista)
It does the exact same thing, but is possibly more clear. Which one you prefer is really up to style and the situation at hand.
What your image looked like it was trying to do, which is a very naive non-set solution, would look like this done in the most simple possible way:
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
nlista = []
for x in a:
if x in b and x not in nlista:
nlista.append(x)
print(nlista)
Note that a set solution will not maintain order. If you need to maintain order of the elements, you should turn the other list into a set and use that, (like the last solution above, but with b turned into a set for performance gain).