title: Sorting dictionary list-values based on time
body: <p>I'm pretty new to python (couple weeks into it) and I'm having some trouble wrapping my head around data structures. What I've done so far is extract text line-by-line from a .txt file and store them into a dictionary with the key as animal, for example. </p>
  
  <pre><code>database = {
      'dog': ['apple', 'dog', '2012-06-12-08-12-59'],
      'cat': [
          ['orange', 'cat', '2012-06-11-18-33-12'],
          ['blue', 'cat', '2012-06-13-03-23-48']
      ],
      'frog': ['kiwi', 'frog', '2012-06-12-17-12-44'],
      'cow': [
          ['pear', 'ant', '2012-06-12-14-02-30'],
          ['plum', 'cow', '2012-06-12-23-27-14']
      ]
  } 
  
  # year-month-day-hour-min-sec                                       
  </code></pre>
  
  <p>That way, when I print my dictionary out, it prints out by animal types, and the newest dates first.</p>
  
  <p>Whats the best way to go about sorting this data by time? I'm on python 2.7. What I'm thinking is</p>
  
  <p>for each key:</p>
  
  <p>grab the list (or list of lists) --> get the 3rd entry --> <code>'-'.split</code> it,  --> then maybe try the <code>sorted(parameters)</code> </p>
  
  <p>I'm just not really sure how to go about this... </p>