diff --git a/src/deck.py b/src/deck.py index df647f1..99395f6 100644 --- a/src/deck.py +++ b/src/deck.py @@ -3,7 +3,7 @@ import random class Deck: def __init__(self, n_decks): self.cards = [] - self.n_decks = n_decks + self.n_decks = int(n_decks) def count(self): return len(self.cards) @@ -12,11 +12,8 @@ class Deck: suits = '♠♥♦♣' cards = 'A234567890JQK' - decks_to_shuffle = int(self.n_decks) - - while decks_to_shuffle > 0: + for _ in range(self.n_decks): self.cards += [card + suit for card in cards for suit in suits] - decks_to_shuffle -= 1 def check(self): if self.count() < 1: