title: Mapping strings to integers in Python
body: <p>For building my Poker game, I abstract a "Hand" as a list of <code>card</code> objects.<br>
  For example, <code>['AC', '3D', '4S', 'KH', 'TC']</code> represents a <code>hand</code> object and each item of the list is a <code>card</code> object. </p>
  
  <p>I want to rank the cards in a hand in descending order of their importance in the game.<br>
  i.e. <code>'A' &gt; 'K' &gt; ....(so on)... &gt; '2'</code></p>
  
  <p>I am looking for mapping the rank of each card to a corresponding value.<br>
  For the above example, the correspondence will be <code>[14, 13, 10, 4, 3]</code></p>
  
  <p>I have the following functions to do this for me:</p>
  
  <pre><code>def mapper(ranks):
      mapping = {
              '2': 2,
              '3': 3,
              '4': 4,
              '5': 5,
              '6': 6,
              '7': 7,
              '8': 8,
              '9': 9,
              'T': 10,
              'J': 11,
              'Q': 12,
              'K': 13,
              'A': 14
          }
      new_ranks = [mapping[rank] for rank in ranks]
      return new_ranks
  
  def card_ranks(cards):
      "Return a list of the ranks, sorted with higher first."
      ranks = [r for r,s in cards]
      return sorted(mapper(ranks), reverse=True) 
  </code></pre>
  
  <p>These functions work fine but I don't find them enough Pythonic.<br>
  I would like to know how can I perform this mapping efficiently(maybe using <code>map</code> function).</p>