[Tutor] inheritance problem
Alan Gauld
alan.gauld at btinternet.com
Fri Oct 1 09:54:35 CEST 2010
"Roelof Wobben" <rwobben at hotmail.com> wrote
>>>> The cards are stored in a directory named cards.
>>
>> Correct. So how do you get a card from the collection stored
>> in self.cards?
>
> This is not correct. Card is a list and not a directory. See this :
> self.cards = []
OK, if thats the mistake you made then you made two mistakes.
1) cards is a list not a directory
and
2) directory is something on your hard disk
not a Python data type, you meant dictionary I assume? :-)
> Now Im busy to make this difficult exercise of writing print_hands()
> But thanks for the time and explantion.
> OOP is difficult to understand I find.
OOP is a step up from functions its true but you need to work to
understand it or you will continue to get confused by trivial errors.
Alan G
More information about the Tutor
mailing list