Professional Documents
Culture Documents
Bank Account Manager
Bank Account Manager
def __str__(self):
return self.name
def open_current(self,acc_num,opening_deposit):
self.accts['C'].append(Current(acc_num,opening_deposit))
def open_savings(self,acc_num,opening_deposit):
self.accts['S'].append(Savings(acc_num,opening_deposit))
def open_business(self,acc_num,opening_deposit):
self.accts['B'].append(Business(acc_num,opening_deposit))
def make_wd(cust,acct_type,acct_num,wd_amt):
"""
make_dep(cust, acct_type, acct_num, wd_amt)
cust = variable name (Customer record/ID)
acct_type = string 'C' 'S' or 'B'
acct_num = integer
wd_amt = integer
"""
for acct in cust.accts[acct_type]:
if acct.acc_num == acct_num:
acct.withdraw(wth_amt)