title: error when trying to call an index from a list of lists in python
body: <p>I have a huge list and I'm trying to make a function that will print the data_sets[51] which is:</p>
  
  <pre><code>['X', ['Sheet A', 'Location 1', 'Upright'],
            ['Sheet B', 'Location 2', 'Upright'],
            ['Sheet C', 'Location 3', 'Upright'],
            ['Sheet D', 'Location 4', 'Upright']],
  </code></pre>
  
  <p>this line if the 51st list inside the first lot of lists</p>
  
  <p>This is my code which is has all the function above it drawing the sheets</p>
  
  <pre><code>def paste_up(position):
  
      for position in data_sets:
          #start location
          if position[1] == "Location 1":
              start_position = (-300, 0)
          elif position[1] == "Location 2":
              start_position = (-100, 0)
          elif position[1] == "Location 3":
              start_position = (100, 0)
          elif position[1] == "Location 4":
              start_position = (300, 0)
  
          #start direction
          if position[2] == "Upright":
              start_direction = (90)
          elif position[2] == "Upside down":
              start_direction = (270)
  
          #draw sheet
          if position[0] == "Sheet A":
              draw_sheetA(start_position, start_direction)
          if position[0] == "Sheet B":
              draw_sheetB(start_position, start_direction)
          if position[0] == "Sheet C":
              draw_sheetC(start_position, start_direction)
          if position[0] == "Sheet D":
              draw_sheetD(start_position, start_direction)
  
  paste_up(data_sets[51])
  </code></pre>
  
  <p>But I am getting this error and I am not sure why, I've tried to change the indexes or use [51][1] but it isn't changing the outcome</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/chalysefoster/Documents/2017/QUT Semester 2/IFB104 Building IT Systems/Assigment 1/billboard.py", line 911, in &lt;module&gt;
      paste_up(data_sets[51])
    File "/Users/chalysefoster/Documents/2017/QUT Semester 2/IFB104 Building IT Systems/Assigment 1/billboard.py", line 883, in paste_up
      if position[1] == "Location 1":
  IndexError: list index out of range
  </code></pre>
  
  <p>Thankyou</p>