-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path7-1.py
More file actions
28 lines (23 loc) · 805 Bytes
/
7-1.py
File metadata and controls
28 lines (23 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Design the data structures for a generic deck of cards. Explain how you would subclass
# the data structures to implement blackjack.
class Card:
def __init__(self, suite, identifier):
self.suite = suite
self.identifier = identifier
class Deck:
def __init__(numberCards, shuffle = False):
self.cards = []
for i in ['Spades', 'Diamonds', 'Hearts', 'Clubs']:
for j in range(1, 14):
if j == 13:
identifier = 'King'
if j == 12:
identifier = 'Queen'
if j == 11:
identifier = 'Jack'
identifier = j
self.cards.append(Card(i, identifier))
if shuffle:
shuffle()
def shuffle(self):
return