title: Sorting a list with both numbers and letters
body: <p>I am a first-year A-Level student and I am trying to sort the list below, which represents a hand in the card game Rummy:</p>
  <pre><code>hand = [(1, '-', '3', 'Spades'), (2, '-', '8', 'Clubs'), (3, '-', '10', 'Hearts'), (4, '-', 'Ace', 'Spades'), (5, '-', '7', 'Clubs'), (6, '-', 'Queen', 'Diamonds'), (7, '-', '10', 'Spades')]
  </code></pre>
  <p>I want it sorted so the suits are in alphabetical order (Clubs, Clubs, Diamonds, Hearts, Spades, Spades, Spades) and where the suit is the same, the card with the lowest value (Ace being lowest, King being highest) comes first. Once sorted, the <code>index[0]</code> values, which just gives a reference number to each card when selecting one in other parts of the program, should be essentially re-assigned so they once again read in order from 1 to 7. I want it to be outputted as this:</p>
  <pre><code>[(1, '-', '7', 'Clubs'), (2, '-', '8', 'Clubs'), (3, '-', 'Queen', 'Diamonds'), (4, '-', '10', 'Hearts'), (5, '-', 'Ace', 'Spades'), (6, '-', '3', 'Spades'), (7, '-', '10', 'Spades')]
  </code></pre>
  <p>I thought about trying to do something like this:</p>
  <pre><code>suit_hand = (hand[0][4], hand[1][4], hand[2][4], hand[3][4], hand[4][4], hand[5][4], hand[6][4])
  arr = sorted(suit_hand)
  </code></pre>
  <p>and then using a standard sorting algorithm, probably an insertion sort, for the card value but I'm not really sure how to go about executing it.</p>
  <p>Any help would be appreciated, thanks.</p>