How to check if a line has one of the strings in a list? [duplicate] December 19, 2023 by Tarik strings = ("string1", "string2", "string3") for line in file: if any(s in line for s in strings): print "yay!"