def DealCard(): """Generator to yield one card at a time from a deck.""" deck = cards.GetCards() #print("before shuffle, deck:", deck) random.shuffle(deck) #print ("after shuffle, deck:", deck) for card in deck: yield card
def DealCard(): """Generator to yield one card at a time from a deck.""" deck = cards.GetCards() random.shuffle(deck) for card in deck: yield card
def __init__(self): self._cards = cards.GetCards() random.shuffle(self._cards)