News for hackers. Stuff that matters.
Re:Show HN: Deck of Cards – A playing card API by hurin on Monday May 11, 2015 @12:18PM (#9525838)

  numbers = ['2','3','4','5','6','7','8','9','10','J','K','Q','A']
  suits = ['CLUBS', 'SPADES', 'HEARTS', 'DIAMONDS']
  deck = [(num,suit) for num in numbers for suit in suits]
  random.shuffle(deck)
  draw_card = lambda deck: deck.pop()

There are no comments on this comment yet.