vendredi 14 juin 2019

search multiple strings in multiple strings

I want to search if 'bit' or 'yit' is in a word of a line I have parsed and split. Also, in the same line but a different word I want to look for 'If' or 'yup'.

The whole code should be in one line.

line=line.split()
if ('bit' or 'yit') in line[0] or ('If' or 'yup') in line[-2] : 

It doesn't execute when I use this code.

This is my input:

"bit2_2" -> 25;
"yup" -> "end4";
"yit" -> "yup69";
 25 -> 56;

Aucun commentaire:

Enregistrer un commentaire