Basically I want to remove a line in my bank.txt file which has names, account numbers and a balance in it.
So far I have how to setup the file and how to check that the information is in the file I'm just not sure as to how I'm going to remove the certain line if the information is the same as what the input looks for.
Any help is appreciated and sorry if I've gotten either this question or the actual code itself formatted incorrectly for the question, don't really use this site much so far.
Thanks in advance.
filename = "bank.txt"
word1 = str(input("What is your name?"))
with open(filename) as f_obj:
for line in f_obj:
if word1 in line:
print(line.rstrip())
print("True")
else:
print("False")