# Write a Python program to How to search for a string in text files string1 = 'coding'  # opening a text filefile1 = open("geeks.txt", "r")  # setting flag and index to 0flag = 0index = 0  # Loop through the file line by linefor line in file1:      index + = 1           # checking string is present in line or not    if string1 in line:              flag = 1      break           # checking condition for string found or notif flag == 0:    print('String', string1 , 'Not Found') else:    print('String', string1, 'Found In Line', index)  # closing text file    file1.close() 