I have to find 6 distincts words in a bunch of lists. For example in first list, there will be word 'me', in second word 'us'.
I've already found the line number using this code:
def creatList(file):
try:
for i,line in enumerate(file,1):
and pass found values to another function,
line=(line.rstrip()).split()
rawList=[]
rawList.append(line)
creatRuleFile(i,rawList)
inside that function,
def creatRuleFile(p,new):
print(new)
print("{0}. {1}".format(p, new))
lookup ='me'
if p==1:
print('found at line:', lookup)
my code is not working as I want... appreciate if you can suggest an answer. Thank you.