Skip to content

Commit 660b0ae

Browse files
committed
Chapter 5: Solutions, suite should be suit
1 parent 9520fba commit 660b0ae

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

chapter5/solutions/shuffle_enhanced.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@
66
import random
77

88
class Card:
9-
def __init__(self, suite, rank):
10-
self.suite = suite
9+
def __init__(self, suit, rank):
10+
self.suit = suit
1111
self.rank = rank
1212

1313
def initialize_deck():
14-
suites = ['Clubs', 'Diamonds', 'Hearts', 'Spades']
14+
suits = ['Clubs', 'Diamonds', 'Hearts', 'Spades']
1515
ranks = ['Ace', '2', '3','4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', 'King']
1616
cards = []
17-
for suite in suites:
17+
for suit in suits:
1818
for rank in ranks:
19-
card = Card(suite, rank)
19+
card = Card(suit, rank)
2020
cards.append(card)
2121
return cards
2222

2323
def shuffle_and_print(cards):
2424
random.shuffle(cards)
2525
for card in cards:
26-
print('{0} of {1}'.format(card.rank, card.suite))
26+
print('{0} of {1}'.format(card.rank, card.suit))
2727

2828
if __name__ == '__main__':
2929
cards = initialize_deck()

0 commit comments

Comments
 (0)