[Tutor] inheritance problem

Joel Goldstick joel.goldstick at gmail.com
Thu Sep 30 22:08:24 CEST 2010


I looked at the chapter before, and found this in particular:

class Deck:
    def __init__(self):
        self.cards = []
        for suit in range(4):
            for rank in range(1, 14):
                self.cards.append(Card(suit, rank))

I think the error in the book has to do with self.pop() instead should
be self.cards.pop()

Since cards are the items in the deck that get moved around, and since
you are dealing at that
line in your code that fails.



>
> --
> Bob Gailer
> 919-636-4239
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>



-- 
Joel Goldstick


More information about the Tutor mailing list