title: Remove a line from a file Python
body: <p>Basically I want to remove a line in my <code>bank.txt</code> file which has names, account numbers and a balance in it. </p>
  
  <p>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.</p>
  
  <p>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. </p>
  
  <p>Thanks in advance.</p>
  
  <pre><code>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") 
  </code></pre>