[python] How to check if a line has one of the strings in a list?