From 6b56e45e9da0e1ca4a80efec2711090dd5be4d35 Mon Sep 17 00:00:00 2001 From: cclauss Date: Wed, 7 Mar 2018 06:30:02 +0100 Subject: [PATCH] deck_of_cards: Do not forget 'self' Discovered via #93 --- .../object_oriented_design/deck_of_cards/deck_of_cards.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solutions/object_oriented_design/deck_of_cards/deck_of_cards.py b/solutions/object_oriented_design/deck_of_cards/deck_of_cards.py index 8dc56548..a4708758 100644 --- a/solutions/object_oriented_design/deck_of_cards/deck_of_cards.py +++ b/solutions/object_oriented_design/deck_of_cards/deck_of_cards.py @@ -68,7 +68,7 @@ class Hand(object): def score(self): total_value = 0 - for card in card: + for card in self.cards: total_value += card.value return total_value @@ -102,9 +102,9 @@ class Deck(object): self.deal_index = 0 def remaining_cards(self): - return len(self.cards) - deal_index + return len(self.cards) - self.deal_index - def deal_card(): + def deal_card(self): try: card = self.cards[self.deal_index] card.is_available = False