(e-mail address removed) wrote:
(just to save you the pain later:
http://wiki.python.org/moin/GoogleGroupsPython
)
So what have you written so far? Is this a homework assignment and
you've been covering certain parts of Python in a certain order? Is it
part of learning some tutorial?
There are so many ways of accomplishing this sort of thing, that without
some constraints, there are a dozen reasonable responses. I'll try one:
in the class Player, you make a pair of methods, purchase() and
income(), which manipulate the instance attribute assets. Then you
make a property that returns the assets.
Class Player:
....
def purchase(self, amount):
self.assets -= amount
def income(self, amount):
self.assets += amount
def wealth(self):
return self.assets