I'm learning to program in Python 2.2.2. I'm trying to simulate a deck of
cards using a list of a Card class that I've created:
def __init__(self, val = None):
self.Pip = val
def __init__(self, numCards):
self = 
for i in range(numCards):
myDeck = Deck(10)
Instantiating myDeck this way does not work, as I end up with an empty list.
I gather that self is local to the __init__ function. Is it possible to
affect a change in the values of the list this way? I will have to deal with
this again later, as I wish to add a sort function that will sort on Pip.