I suggest you familiarize yourself with the Python traceback, which tells you where and how things have gone wrong. In your case:
Traceback (most recent call last):
File "main.py", line 19, in <module>
print(food)
File "/home/runner/7Qh8qK21lEl/budget.py", line 43, in __str__
s += i["description"][:23].ljust(23) + str("{:.2f}".format(i["amount"]).rjust(7)) + "\n"
TypeError: tuple indices must be integers or slices, not str
So, print(food) on line 19 of main.py is calling the __str__ method of your Category instance, which is failing on line 43 of budget.py due to a TypeError. Specifically, a tuple is being accessed with a string index, when — as the error message states — tuple indices must be integers or slices, not strings.
I read the python traceback, and for some reason, my brain didn’t connect that I can have a dictionary inside a list. So I thought I had to make a tuple with the amount and description and append that to the list, which obviously didn’t work. So when realized that I forgot to remove the parentheses that make it a tuple. I usually check for errors like these using print statements, but I couldn’t really do that since this is a class. That’s also why I forgot that print statement in there while I was debugging!