I am working on the Budget Application and have run into a problem. A transfer of funds is happening between two instances of the same class. It has to be set up so when I call the method I just have to enter the amount and destination of the transfer.
`Preformatted text`def transfer(self, amount, destination): if amount<= self.currentbalance: self.withdraw(amount) description.deposit(amount)`Preformatted text`
The withdrawal is easy, I can just use self.withdraw(), but for the deposit I need to reference another instance of the class. This code comes back with the error AttributeError: ‘str’ object has no attribute ‘deposit’.
I tried description.name.deposit(amount), to try and reference the name of the instance (which is a sting). I saw other posts saying using .name was the solution, but I don’t understand how to make it work.
Any help would be really appreciated.