Bank Account help


#1

Error message is…
Lord Noah’s account. Balance: $0.00
$0.00
Traceback (most recent call last):
File “bankaccount.py”, line 28, in
my_account.deposit(2000)
File “bankaccount.py”, line 14, in deposit
print “You deposit $%.2f” % (self.amount)
AttributeError: ‘BankAccount’ object has no attribute
’amount’


#2

I believe your error has to do with how you reference “amount”. It is not an attribute of self, it is a passed parameter. You can see that you correctly reference it as “amount” twice but once you reference it as “self.amount”.

image


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.