I've tried numerous ways and sometimes it get the last known match, sometimes it just stops at the first, and sometimes it never works at all. My goal is to find every matching word within a phrase and print EACH PHRASE if true. I tried doing something like this(PSUEDO'ISH)-Do not judge code it's merely the best example I could think of as I typed:
f = open("dognames.txt", "r")
key = "Bob"
if key in f:
print line
Dog names being in text file:
Bob
Bobby
Kitty
Bobbel
Boaban
Cat
Output should be:
Bob
Bobby
Bobbel