I have a file that contains
"1111 1111 1111 // google
1111 1111 1111 // google talk browser
1111 1111 1111 // google talks
1111 1111 1111 // google talk"
I want to print only “// google talk” related line (only 4th line)
tried like this this not working…
with open('file.txt', 'r') as handle:
for index, line in enumerate(handle, 1):
if line.strip() == 'talk':
print 'Match found on line', index
1 Answer