When I am trying to print my_account I get this error
my_account = BankAccount(“Matthew”)
Type error: object() takes no parameters
I have no clue of what it either means or how to fix it.
If someone could be kind enough to explain what the problem is I would be very grateful
This is the code that I have problems with
class BankAccount(object): balance = 0 def __init_(self, name): self.name = name def __repr__(self): return "This account belongs to %s. Your balance is $%.2f" % (self.name, self.balance) def show_balance(self): print "Your balance is %.2f$" % self.balance def deposit(self, amount): if self.amount <= 0: print "Your deposit amount is too low" return else: print "Depositing %.2f to your account" % amount self.balance += amount show_balanace() def withdraw(self, amount): if amount > self.balance: print "Your withdrawal exceeds your balance" return else: print "You are withdrawing %.2f$" % amount self.balance -= amount show_balance() my_account = BankAccount("name") print my_account