title: Why can't I insert values to a list?
body: <p>I have a problem with a part of my program in Python 3.7.</p>
  
  <p>It's a program, where you can add vocabulary with their translation in any language to a .txt file and this program can ask you a word and you enter the translation - this is working fine.</p>
  
  <p>Receiving this data works also very good. But I also want to save the two languages, which you enter in the program, to this .txt file. </p>
  
  <p>I can add these two to the first line of the .txt file and if I try to print the first line of this file it also works, but I need to split the two values of the text file, because they are written like this in the text file (f.e):
  <code>German - English</code></p>
  
  <p>Finally I want to add this two split values to a new list. But if I try to print the first value of the list, I get following error:</p>
  
  <blockquote>
    <p>IndexError: list index out of range</p>
  </blockquote>
  
  <p>and if I check if the list is empty, I can see that it is empty, but why?</p>
  
  <p>Thanks for your help</p>
  
  <p>This is my code, which is responsible for this error:</p>
  
  <pre><code>new_currSprache = []
  
  with open(name + ".txt", "r") as file:
      lines = file.readlines()
      for lines[0] in file.readlines():
          lang_1, lang_2 = lines[0].split(" - ")
          print(lang_1)
          print(lang_2)
          new_currLanguage.append(lang_1, lang_2)
      firstLanguage = new_currLanguage[0]
      secondLanguage = new_currLanguage[1]
  </code></pre>