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?
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']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With