Hello,
So i had some difficulties with the creation of the class Category.
First i tried to work with nested dictionnaries but then i realised it didn’t do what i wanted. I didn’t understand how i could filter out the “name of the category” to show the different info of categories. I even tried to make new list names to make it workable.
ledger {"name category": {description: amount}}
''' Creating lists
for i in range(1,6):
globals()["my_list_"+str(i)] = []
for j in range(10):
globals()["my_list_"+str(i)].append(j)'''
So i watched some more video’s about classes and i understood i was completely wrong about how i could solve it.
Anyway, now i have a pritty workable (not yet done tho) code. I understand that every Category i make, i am creating an “object” (i think).
food = budget.Category("Food")
food.deposit(1000, "initial deposit")
food.withdraw(10.15, "groceries")
food.withdraw(15.89, "restaurant and more food for dessert")
print(food.get_balance())
clothing = budget.Category("Clothing")
food.transfer(50, clothing)
i even think i understand why the object clothing has to be made first before transferring money to it.
Now i am trying to see if its possible to see what the objects are doing behind the scene? I there a way to track those object and understand whats in it?
Thanks
Joris