if \'string1\' in line: ...
... works as expected but what if I need to check multiple strings like so:
if \'string1\' or \'string2
You have this confusion Because you don't understand how the logical operator works with respect to string.
Python considers empty strings as False and Non empty Strings as True.
Proper functioning is :
a and b returns b if a is True, else returns a.
a or b returns a if a is True, else returns b.
Therefore every time you put in a non empty string in place of string1 the condition will return True and proceed , which will result in an undesired Behavior . Hope it Helps :).