title: How to sort multidimensional array by column?
body: <p>Is there a way to use the sort() method or any other method to sort a list by column? Lets say I have the list:</p>
  
  <pre><code>[
  [John,2],
  [Jim,9],
  [Jason,1]
  ]
  </code></pre>
  
  <p>And I wanted to sort it so that it would look like this:</p>
  
  <pre><code>[
  [Jason,1],
  [John,2],
  [Jim,9],
  ]
  </code></pre>
  
  <p>What would be the best approach to do this?</p>
  
  <p>Edit:</p>
  
  <p>Right now I am running into an index out of range error. I have a 2 dimensional array that is lets say 1000 rows b 3 columns. I want to sort it based on the third column. Is this the right code for that? </p>
  
  <pre><code>sorted_list = sorted(list_not_sorted, key=lambda x:x[2])
  </code></pre>