Coding help...very basic

Igorati wade_stoddard at yahoo.com
Sun Mar 13 13:38:50 EST 2005


Hello all, I am still needing some help on this code, I have gone a bit
further on it. Thank you for the help. I am trying to understand how to
make the file searchable and how I am to make the deposit and withdrawl
interact with the transaction class. 

class Account:
    def __init__(self, initial):
         self.balance = initial
    def deposit(self, amt):
         self.balance = self.balance + amt
    def withdraw(self, amt):
         self.balance = self.balance - amt
    def getbalance(self):
         return self.balance 

class Transactoin:
    def transaction(self,                                                 
               
        self.transaction = 
    import time
    time.asctime()
    raw_input("Is this a deposit or withdrawl?")
    if withdrawl:
    elif     
    raw_input("Please enter amount here.")
       
class Deposit(Transaction):
    def deposit(self, amt):
        self.balance = self.balance + amt
    def getbalance(self):
        return self.balance

class Withdrawl(Trasaction):
    def withdrawl(self, amt):
        self.balance = self.balance - amt
    def getbalance(self):
        return self.balance
import pickle
pickle.dump ((withdrawl), file ('account.pickle', 'w'))
pickle.dump ((deposit), file ('account.pickle', 'w'))



print "Your current account total is.", self.balance





More information about the Python-list mailing list