The
find
method returns the index to the first occurrence of the find target. You are only printing the ones where the index is zero. Change your loop to:
for line in fhand:
line=line.rstrip()
if(line.find('python') != -1):
print(line)
In future please format your code properly between <pre lang="Python"></pre> tags, as I have done here. It makes it more readable.