MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / Deck

Class Deck

projects/BlackJack/black_jack.py:50–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48
49
50class Deck:
51 def __init__(self):
52 self.all_cards = []
53 for suit in suits:
54 for rank in ranks:
55 # This assumes the Card class has already been defined!
56 self.all_cards.append(Card(suit, rank))
57
58 def shuffle(self):
59 random.shuffle(self.all_cards)
60
61 def deal_one(self):
62 # we remove one card from the list of all_cards
63 return self.all_cards.pop()
64
65
66def check_ace(card):

Callers 1

black_jack.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected