Paste Search Dynamic
deck append
  1. import random
  2.  
  3. suits = 'cdsh'
  4. face = 'AKQJ'
  5.  
  6. deck = []
  7.  
  8. for s in suits:
  9.     for f in face:
  10.         deck.append('{}{}'.format(f,s))
  11.     for n in range(2,11):
  12.         deck.append('{}{}'.format(n,s))
  13.  
  14. for l in range(0,50):
  15.     for x in range(0,7):
  16.         random.shuffle(deck)
  17.  
  18.     hands = []
  19.    
  20.     for h in range(0, 3):
  21.         card1 = deck[h*2]
  22.         card2 = deck[h*2+1]
  23.         hands.append('{} {}'.format(card1, card2))
  24.  
  25.     hand_str = ' | '.join(hands)
  26.     flop = ' '.join(deck[7:10])
  27.     turn = deck[11]
  28.     river = deck[13]
  29.    
  30.     print(hand_str, '==>', flop, turn, river)
  31.  
  32.  
Parsed in 0.009 seconds