I'm new to Python as well, but I think I could offer some help.
Well if you're looking to find lines that match up, instead of words, then you can do something like this:
file1 = open("file1.txt", "r")
file2 = open("file2.txt", "r")
file3 = open("file3.txt", "a")
file1.seek(0,0)
file2.seek(0,0)
list1 = file1.readlines()
list2 = file2.readlines()
for i in list1:
for j in list2:
if i == j:
file3.write("FILE 1:",i)
file3.write("FILE 2:",j)
Now if you are talking about words, then you can probably go through each list and use
<string>.split() on it, so you have each word in a seperate list item, but I'm not sure if that would work. Just an idea, really.
Hope I helped.