How to write double condition for list comprehensions?

Viewed 39

I have a list of strings. I want to remove those strings that have '\x1b' and '1' in them. my list is called lst. I tried this:

[i for i in lst if j not in ['\x1b', '1'] for j in i]

But it does not work. It says

UnboundLocalError: local variable 'j' referenced before assignment.

How to do it right?

0 Answers
Related