def random_cards(count=1): if count == 1: return Card(random.choice(list(RANKS.values())), random.choice(list(SUITS.values()))) cards = set() while len(cards) < count: cards.add(Card(random.choice(list(RANKS.values())), random.choice(list(SUITS.values())))) return cards
def random_cards(count=1): if count == 1: return Card(random.choice(list(RANKS.values())), random.choice(list(SUITS.values()))) cards = set() while len(cards) < count: cards.add( Card(random.choice(list(RANKS.values())), random.choice(list(SUITS.values())))) return cards
def setUp(self): self.deck = [Card(rank, suit) for rank in RANKS.values() for suit in SUITS.values()]
def setUp(self): self.deck = [ Card(rank, suit) for rank in RANKS.values() for suit in SUITS.values() ]