title: Python custom sort by multiple factors
body: <p>If I have a (python) list like so</p>
  
  <pre><code>my_list = [
      'Large Spearmint Bag Back',
      'Large Peppermint Bag Back',
      'Large Cinnamon Bag Back',
      'Small Peppermint Bag Front',
      'Medium Peppermint Bag Front',
      'Family Shot',
      'Large Cinnamon Bag Front',
      'Large Peppermint Bag Front',
      'Large Spearmint Bag Front',
  ]
  </code></pre>
  
  <p>You'll notice in the list there are sets of items, like so <code>Large Spearmint Bag Front</code> and <code>Large Spearmint Bag Back</code> where the only difference is one is the front and one is the back.  I need to sort these in alphabetical order, but have the front come before the backs so that the output would look like this:</p>
  
  <pre><code>[
      'Family Shot',
      'Large Cinnamon Bag Front',
      'Large Cinnamon Bag Back',
      'Large Peppermint Bag Front',
      'Large Peppermint Bag Back',
      'Large Spearmint Bag Front',
      'Large Spearmint Bag Back',
      'Medium Peppermint Bag Front',
      'Small Peppermint Bag Front'
  ]
  </code></pre>
  
  <p>I'm not even sure this is possible with the built in <code>sorted</code> function.  Can you help me solve this problem? </p>