title: How to change last parameter in file by first
body: <p>This program must change the last parameter on a line based on the starting code.</p>
  
  <p><em>File now:</em></p>
  
  <pre><code>312|fotelja snesko|bela|15|2900|fotelja|False
  621|digimon tabure|crna|25|850|tabure|False
  </code></pre>
  
  <p>Code is:>> 312 </p>
  
  <p><em>File after:</em></p>
  
  <pre><code>312|fotelja snesko|bela|15|2900|fotelja|True
  621|digimon tabure|crna|25|850|tabure|False
  </code></pre>
  
  <p>My work right now.</p>
  
  <pre><code>parameter = input("\nCode is &gt;&gt; ")
  
  with open("komad_namestaja.txt", "r") as fileNAME:
      allDATA = fileNAME.readlines()
      for linija in allDATA:
          linija = linija.split("|")
  
          if parameter == linija[0]:
              linija[6] = "True"
  </code></pre>
  
  <p>With this I read every line in the file and found the line that I need. I just need to change <code>False</code> to <code>True</code> in that line. How can I change it?</p>