Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f388143

Browse files
Changed blackjack.py
1 parent 156ded3 commit f388143

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎Blackjack/blackjack.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
# CLASSES
99

1010
class Card: # Creates all the cards
11-
12-
suits = ('Hearts', 'Diamonds', 'Spades', 'Clubs')
13-
ranks = ('Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Jack', 'Queen', 'King', 'Ace')
1411

1512
def __init__(self, suit, rank):
1613
self.suit = suit
@@ -21,11 +18,14 @@ def __str__(self):
2118

2219

2320
class Deck: # creates a deck of cards
24-
21+
22+
suits = ('Hearts', 'Diamonds', 'Spades', 'Clubs')
23+
ranks = ('Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Jack', 'Queen', 'King', 'Ace')
24+
2525
def __init__(self):
2626
self.deck = [] # haven't created a deck yet
27-
for suit in suits:
28-
for rank in ranks:
27+
for suit in Deck.suits:
28+
for rank in Deck.ranks:
2929
self.deck.append(Card(suit, rank))
3030

3131
def __str__(self):

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /