title: Is it possible class instance with this method?
body: <pre><code>class Category:
  
      def __init__(self,name):
          self.name = name
          self.ledger = ['','','']
  
      def deposit(self, amount, description=''):
          self.amount = amount
          self.description = description
          self.ledger[0] = {&quot;amount&quot;: amount, &quot;description&quot;: description}
  
      def withdraw(self, withdraw_amount,description=''):
          self.withdraw_amount = withdraw_amount
          self.description = description
          self.ledger[1] = {&quot;amount&quot;: -withdraw_amount, &quot;description&quot;: description}
  
      def transfer(self, transfer_amount, budget_category=''):
          self.transfer_amount = transfer_amount
          self.ledger[2] = {&quot;amount&quot;: -transfer_amount, &quot;description&quot;: &quot;Transfer to &quot; + 
                             budget_category
  </code></pre>
  <p>Even now I don't understand how I use bank accounts function only with one class.<br />
  Everything is OK except for money transfer function.<br />
  <strong>When I transfer money to another category I have to make class variable ledger with this way</strong></p>
  <p>If the money is 500:</p>
  <pre><code>food = Category('Food')
  food.deposit(1000)
  cloth = Category('Clothing')
  food.transfer(500,'Clothing')
  </code></pre>
  <p>And the result is:</p>
  <pre><code>food.ledger[2] = {&quot;amount&quot;: -500, &quot;description&quot;: &quot;Transfer to Clothing&quot;}
  clothing.ledger[0] = {&quot;amount&quot;: 500, &quot;description&quot;: &quot;Transfer from Food&quot;}
  </code></pre>
  <p>How is it possible to run <code>cloth.deposit()</code> when <code>food.transfer()</code> run at once? Is it impossible or just is my code wrong? I need help.</p>