I believe your fourth line is wrong.
You have:
You have:
c = [i for i in a if a in b]But it should be:
c = [i for i in a if i in b]Edit: This was already said, never mind