title: python split function does not work as expected
body: <p>I am having a hard time to formulate what my problem is... It concerns this piece of code here:</p>
  
  <pre><code>def txt_to_dict_ad():
  
      my_dict = {}    
  
      with open('database.txt', 'r') as file:
          for line in file:
              temp = list(line.strip().split('-'))
              my_dict[temp[1].strip('\n')] = temp[0]
  
      return my_dict
  </code></pre>
  
  <p>When I run it and for example want to print the output of this function, I am getting an "index out of range" error for the line containing temp[1] and temp[0]. Why is that? And how can I avoid it?</p>
  
  <p>The txt file contains Arabic and German vocabulary,
  Example data: Auto - سيارة</p>