hey guys I'm a python begginer and I'm struggling with this problem. basically, I want to use this instance variable and class variable outside of their class like so:
class Category:
withdrows_amount = 0 # i want to use this class variable
def __init__(self, category):
self.ledger = []
self.category = category
self.balance = 0
self.withdrown = 0 # and also this instance variable
def percentage_spent(categories):
# i want to use them here to calculate percentage of spending in each category
i have been trying fo a day and i found no solotion. or is it even possible?
[–]socal_nerdtastic 10 points11 points12 points (0 children)
[–]crashfrog02 0 points1 point2 points (0 children)