title: How to sort a list/tuple of lists/tuples by the element at a given index?
body: <p>I have some data either in a list of lists or a list of tuples, like this:</p>
  
  <pre><code>data = [[1,2,3], [4,5,6], [7,8,9]]
  data = [(1,2,3), (4,5,6), (7,8,9)]
  </code></pre>
  
  <p>And I want to sort by the 2nd element in the subset. Meaning, sorting by 2,5,8 where <code>2</code> is from <code>(1,2,3)</code>, <code>5</code> is from <code>(4,5,6)</code>. What is the common way to do this? Should I store tuples or lists in my list?</p>