[Tutor] bEGINNING PROGRAMMER NEEDS HELP WITH CLASSES. CHECK CODE
Thomi Richards
thomi@thomi.imail.net.nz
Tue Nov 19 04:24:01 2002
> Pretty sure the problem lies in the def init line. Can anyone help?
OKJ, I'm not yet very good with clases, but shouldn't it be something
like this:
>
> #Account manager program
> from time import time, ctime
> initial = input("Type in the initial balance of your account:")
Class blah(blah blah blah)
> def __init__(self, initial):
> return initial
> def deposit(initial, amt):
> return initial + amt
> def withdraw(initial,amt):
> return initial - amt
> def getbalance(initial,amt):
> return balance
>
etc. etc. etc.??
Take a look at the classes page in teh python tutorial. It does a fairly
good job of explaining it.
--
Thomi Richards
thomi@imail.net.nz
http://ddmodd.sourceforge.net/
Thomi Richards,
thomi@imail.net.nz