I'm trying to iterate through a search list, I've written it like I would in C but I want to re-write this more pythonic.
I've been trying with enumerate but I can't seem to get it to work, It is searching lines of data for key-words which are saved in an array called strings, can someone show me or explain the correct python syntax please.
thanks
for line in f:
jd = json.loads(line)
N=0
while N<=(len(strings)-1):
if findWholeWord(strings[N])(line) != None:
print (jd['user_id'], jd['text'])
break
N=N+1
forloop, instead ofwhile.