Build a budget app - build a budget app

Does anyone know why my code just suddenly stop passing all the test it passed before? It seems to be because of line 42 but i cant see what is wrong with it?

class Category:

def \__init_\_(self,name):

    self.name = name

    self.ledger = \[\]

def deposit(self,amount, description=""):

    self.ledger.append({"amount": amount, "description": description})



def withdraw(self, amount, description=""):

    if self.check_funds(amount):

        self.ledger.append({"amount": -amount, "description": description})

        return True

    else:

        return False



def get_balance(self):

    balance = 0

    for transaction in self.ledger:

        balance += transaction\['amount'\]    

    return balance



def check_funds(self, amount):

    return amount <= self.get_balance()



def transfer(self, amount, destination_category):

    if self.check_funds(amount):

        self.withdraw(amount, f"Transfer to {destination_category.name}")

        destination_category.deposit(amount, f"Transfer from {self.name}")

        return True

    else:

        return False

def \__str_\_(self):

    listled = \[\]

    num = 0



    for item in self.ledger:

     amount = item\["amount"\]

     description = item\["description"\]

     right_bit = 30 - len(description)

     listled.append(f"{description:<0}{amount:>{right_bit}}") 

     num += 1

    

    return f"{self.name.center(30, '\*')}\\n{'\\n'.join(listled)}\\nTotal: {self.get_balance()}"

food = Category(“food”)

food.deposit(1000, “first dep”)

print(getattr(food , “ledger”))

rent = Category(“Rent”)

rent.deposit(2000 , “First rent dep”)

food.transfer(1000, rent)

rent.withdraw(20, “Kids soccer game”)

rent.withdraw(60 , “Nandoes”)

rent.withdraw(100, “El cinco”)

rent.transfer(500 , food )

print(rent.get_balance())

print(food.get_balance())

print(rent)

so u dont have the make objects

Hi @tarawalliealexander , welcome to freeCodeCamp’s forum ! :waving_hand:

If you need help on a specific project, please use the help button !

this will make your problem easier to understand for anyone.