title: convert list of values from a txt file to dictionary
body: <p>So i have this txt file called "Students.txt", I want to define a function called load(student)
  so i have this code:</p>
  
  <pre><code>def load(student):
        body
  </code></pre>
  
  <p>im not quite sure what to write for the body of code so that it reads the file and returns the value from the file as dictionary. I know it would be something like readlines()
  anyway, the file students.txt looks like this:</p>
  
  <pre><code>P883, Michael Smith, 1991
  L672, Jane Collins, 1992
  (added)L322, Randy Green, 1992
  H732, Justin Wood, 1995(added)
  ^key  ^name        ^year of birth 
  </code></pre>
  
  <p>the function has to return as a dictionary that looks like this:</p>
  
  <pre><code>{'P883': ('Michael Smith',1991),
  '(key)':('name','year')}
  </code></pre>
  
  <p>I managed to return the values by trial and error however i cant make new lines and keep returning \n. </p>
  
  <p>===============
  this question has been answered and i used the following code which works perfectly however when there is a space in the values from the txt file.. (see added parts) it doesnt work anymore and gives an error saying that list index is out of range</p>