title: Sorting lists based on a particular element - Python
body: <p>How do I sort a list of lists based on the first element of the lists in Python?</p>
  
  <pre><code>&gt;&gt;&gt; list01 = (['a','b','c'],['b','a','d'],['d','e','c'],['a','f','d'])
  &gt;&gt;&gt; map(sorted, list01)
  [['a', 'b', 'c'], ['a', 'b', 'd'], ['c', 'd', 'e'], ['a', 'd', 'f']]
  &gt;&gt;&gt; sorted(map(sorted, list01))
  [['a', 'b', 'c'], ['a', 'b', 'd'], ['a', 'd', 'f'], ['c', 'd', 'e']]
  </code></pre>