Relative Content

Tag Archive for pythoncsvdebuggingfile-io

find the line in which a given word occurs in a .txt file using python(not duplicate)

The goal is to find the line in which a word occurs in a given .txt file.
In my code I’ve defined a function and have used with open syntax.When I execute it,all i get is “enter the word you want to find” and when i enter the word,the execution automatically ends.I’ve been cracking my head as to where I went wrong,but could’nt spot my mistake.I’d be greatful if you can spot the error in the above code.