Python: 'as' keyword in list comprehension?
keyword, list, list-comprehension, python
Solution
You can use use a generator expression inside the list comprehension:
c = [a for a in (m.split('=')[1] for m in matches) if a != '1']
Problem
I know this won't work but you guys get the idea. ``` c = [m.split('=')[1] as a for m in matches if a != '1' ] ``` Is there a way to archive this? If you use a list comprehension like ``` c = [m.split('=')[1] as a for m in matches if m.split('=')[1] != '1' ] ``` two lists will be build from the `split`, right?