Tell us what’s happening:
when I call ‘transfer’ method, I get error like this…
Traceback (most recent call last):
File “C:\Users\visha\Desktop\Python\budget.py”, line 69, in
food.transfer(200,‘clothing’)
File “C:\Users\visha\Desktop\Python\budget.py”, line 39, in transfer
descrip.deposit(amt, f"Transfer from {self.category}")
AttributeError: ‘str’ object has no attribute ‘deposit’
because of this error I am able to add ‘Transfer to [Category]’ entry, but not able to make entry in the Category where I am transferring.
Your code so far
def transfer(self,amt = 0.0,descrip = ‘’):
if Category.check_funds(self,self.amount) == True:
self.withdraw(amt,('Transfer to '+ descrip))
descrip.deposit(amt, f"Transfer from {self.category}")
# Category(self.category).ledger.append({“amount”: (amt), “description”: 'Transfer from ’ + self.category})
# self.ledger.append({“amount”: -(amt), “description”: transfer_category})
return True
else:
return False
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Challenge: Scientific Computing with Python Projects - Budget App
Link to the challenge: