word = input("Enter the word to search for: ") line_number = 0 text = open('current_line.txt', 'r') for number, line in enumerate(text): if word in line: line_number = number break text.close() print(line_number)
break
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)