title: Problem with assigning multiple values to multiple variables in python
body: <p>I don't understand why my code does not work. let's say the file i'm trying to open contains this:</p>
  
  <pre><code>Luke,89,94,81,97
  Eva,40,50,65,90
  Joseph,55,58,54,99
  Oliver,73,74,89,91
  </code></pre>
  
  <p>And this is the function i've written:</p>
  
  <pre><code>def my_func(myfile):
      out_dict = {}
      somefile = open(myfile)
      data = somefile.readlines()
      for line in data:
          name,course1,course2,course3,course4 = line
          out_dict[name] = [float(course1), float(course2), float(course3), float(course4)]
      return out_dict
  print(my_func("newfile.txt"))
  </code></pre>
  
  <p>i'm trying to add each line to a dictionary where the name of each person is the key.
  My problem is at line 6 where i try to assign 5 values to 5 variables. I get the value error saying "too many values to unpack (expected 5)". but when i use this line of code instead of the original one it works:</p>
  
  <pre><code>name,course1,course2,course3,course4 = line.split(',')
  </code></pre>
  
  <p>As far as i know something like this works:</p>
  
  <pre><code>v,x,z,y = "John",1,2,3
  </code></pre>
  
  <p>But why does not the original code at line 6 work as well?</p>