words = ["apple", "banana", "avocado"]for i, ln in enumerate(open(flnm)): if all(word in ln for word in words): print "Found all in line %d" % (i), ln,

Note that it's not clear from your post whether you're looking for presence of words or substrings. e.g. "apple" is a sub-string of "I like pineapples" but this line doesn't have a word "apple". It's also not quite clear whether you want all words or any.