Update File Data.py

import re

with open("input.txt", "r") as f :
lst = f.readlines()
for i, j in enumerate(lst) :
if re.search(".*Shila*.", j) :
lst[i] = "I love Purnima\n"

with open("input.txt", "w") as f :
f.writelines(lst)

Comments