MCPcopy Index your code
hub / github.com/geekcomputers/Python / Deck

Class Deck

BlackJack_game/blackjack_rr.py:60–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59
60class Deck:
61 def __init__(self):
62 self.deck = []
63 for suit in suits:
64 for rank in ranks:
65 self.deck.append(Card(suit, rank))
66
67 def __str__(self):
68 deck_comp = ""
69 for card in self.deck:
70 deck_comp += "\n " + card.__str__()
71
72 def shuffle(self):
73 random.shuffle(self.deck)
74
75 def deal(self):
76 single_card = self.deck.pop()
77 return single_card
78
79
80class Hand:

Callers 1

blackjack_rr.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected