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
a = Account(1000.00)
a.deposit(550.23)
a.deposit(100)
a.withdraw(50)
print a.getbalance()
Je reçois cette erreur quand je lance ce code .. AttributeError: Compte instance n'a pas d'attribut « dépôt »AttributeError AIDE!
Votre indentation est erronée. –