dimanche 21 juillet 2019

Python list comprehension : AND conditionnal statement in if statement only takes the second condition

I'm trying to do a list comprehension to select some string in a list. I used an If statement with an AND conditional statement to get the strings with the 2 words they should have in it. Unfortunately I don't understand why my list comprehension only take second condition.
Here's an image to understand better :
https://i.imgur.com/QbKs9kP.png

code :

[p for p in point_path_unique if ('Gerüst 25' and 'Eingangswelle') in p]

Aucun commentaire:

Enregistrer un commentaire