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?