Reputation: 1
I am trying to compare two .txt files and find out every common word in the two (ignoring case sensitivity. If someone could point me towards the right direction that would be helpful. (I don't have any python writing experience, just editing a few scripts)
Upvotes: 0
Views: 1860
Reputation: 104
This will give you list containing common words from two files. Output format is list.
with open('a','r') as f, open('b','r') as g:
l=f.readlines()
l1=g.readlines()
print list(set(l)&set(l1))
Upvotes: 1