Skip to content
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

Commit 714292f

Browse files
committed
minor tweaks to Ch01
1 parent 2e99c3d commit 714292f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

01-data-model/frenchdeck.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
Card = collections.namedtuple('Card', ['rank', 'suit'])
44

5+
56
class FrenchDeck:
67
ranks = [str(n) for n in range(2, 11)] + list('JQKA')
78
suits = 'spades diamonds clubs hearts'.split()
89

910
def __init__(self):
1011
self._cards = [Card(rank, suit) for suit in self.suits
11-
for rank in self.ranks]
12+
for rank in self.ranks]
1213

1314
def __len__(self):
1415
return len(self._cards)

README_vs.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## How to run doctest
2+
3+
$ (venv_dev) cd ./01-data-model
4+
$ (venv_dev) python -m doctest frenchdeck.doctest

0 commit comments

Comments
 (0)