Multiple value checks using 'in' operator (Python) -
if 'string1' in line: ...
... works expected if need check multiple strings so:
if 'string1' or 'string2' or 'string3' in line: ...
... doesn't seem work.
if any(s in line s in ('string1', 'string2', ...)):
Comments
Post a Comment