What is the best way to store the cards and suits in python so that I can hold a reference to these values in another variable?
For example, if I have a list called
Poker servers tend to use a 2-character string to identify each card, which is nice because it's easy to deal with programmatically and just as easy to read for a human.
>>> import random
>>> import itertools
>>> SUITS = 'cdhs'
>>> RANKS = '23456789TJQKA'
>>> DECK = tuple(''.join(card) for card in itertools.product(RANKS, SUITS))
>>> hand = random.sample(DECK, 5)
>>> print hand
['Kh', 'Kc', '6c', '7d', '3d']
Edit: This is actually straight from a poker module I wrote to evaluate poker hands, you can see more here: http://pastebin.com/mzNmCdV5