[Tutor] Help with Code (beginner) Error message

DAVID BRALLIER bralzd@hotmail.com
Tue Nov 19 19:49:01 2002


Trying to make a simple program that manages a small bank account. (College 
assignment) I get an error message saying that "deposit is not defined" but 
as you can see I have defined it. Here is the code:



#Account manager program
from time import time, ctime
class account:
    def __init__(self,initial):
        self.balance = initial
    def withdraw(self,amt):
        return initial - amt
    def deposit(self, amt):
        self.balance = self.balance + amt
    def getbalance(self):
        return self.balance


list = [deposit(550.23),deposit(100), withdraw(50)]
for transaction in list:
    print "The balance is: ", transaction.getbalance()
    print "The time of your transaction is: ", ctime (time())


_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus