Mar-26-2017, 02:23 AM
Quote:pickACard = random.choice (suites)this is choosing a random element from each list once. You then are just reusing each chosen one instead of getting a new one
pickAFace = random.choice (cardFaces)
import random suites = ['Hearts' , 'Diamonds' , 'Spades' , 'Clubs'] cardFaces = ['Ace', 2,3,4,5,6,7,8,9,'Jack','Queen','King'] hand = [] for i in range(5): # do the body five times card = random.choice(suites) , random.choice(cardFaces) hand.append(card) for card in hand:print(random.choice(hand))
Recommended Tutorials: