title: Partition list of tuples based on a value within each tuple
body: <p>I am trying to sort a set of data in to 2 separate lists, fulltime and parttime. But it doesn't seem to be working. Can somebody point to where I'm getting this wrong?</p>
  
  <pre><code>data = [(['Andrew'], ['FullTime'], [38]), 
         (['Fred'], ['PartTime'], [24]), 
         (['Chris'], ['FullTime'], [38])]
  
  def sort(var1, datadump):
      positionlist = []
      for b in range(0, len(datadump)):
          temp2 = datadump[b][1]
          if (temp2 == var1):
              positionlist.append(datadump[b])
      return (positionlist)
  
  FullTimeList = sort("FullTime", data) 
  PartTimeList = sort("PartTime", data)
  
  print(FullTimeList) 
  print(PartTimeList)
  </code></pre>