title: Python Error: List Object Not Callable with For Loop
body: <p>Alright so i'm having this TypeError: 'list' object is not callable</p>
  
  <p>It's on the for loop below the (if type=='D')</p>
  
  <p>Exact error is as follows:</p>
  
  <pre><code>     Traceback(most recent call last):
       file"test.py", line 55 in &lt;module&gt;
       main()
       File "test.py", line 49, in main
       for i in range(len(accountlist())):
       TypeError: 'list' object is not callable
  </code></pre>
  
  <p>My code is below, i've tried putting each parenthesis in brackets and renaming the list to something different, always getting around the same error.</p>
  
  <p>What am i doing wrong here?</p>
  
  <pre><code>class BankAccount:
  
  def __init__(self, getbankaccount, inputAmount=0):
  
      self.__balance = inputAmount
  
      self.__numDeposits = 0
  
      self.__numWithdrawals = 0
  
      self.__totalDeposits = 0
  
      self.__totalWithdrawals = 0
  
      self.__getbankaccount=getbankaccount
  
  def getBalance(self):
  
      return self.__balance
  
  def getNumDeposits(self):
  
      return self.__numDeposits
  
  def getNumWithdrawals(self):
  
      return self.__numWithdrawals
  
  def getTotalDeposits(self):
  
      return self.__totalDeposits
  
  def getTotalWithdrawals(self):
  
      return self.__totalWithdrawals
  
  def getbankaccount(self):
  
      return self.__getbankaccount
  
  def Deposit(self,amount):
  
      self.__balance = self.__balance + amount
  
      self.__numDeposits = self.__numDeposits + 1
  
      self.__totalDeposits = self.__totalDeposits + amount
  
      return self.__balance
  
  def Withdrawal(self,amount):
  
      if (self.__balance &gt;= amount):
  
          self.__balance = self.__balance - amount
  
          self.__numWithdrawals = self.__numWithdrawals + 1
  
          self.__totalWithdrawals = self.__totalWithdrawals + amount
  
          return True
  
      else:
  
          return False
  
  
  def main():
  accountlist=[]
  
  numbers=eval(input())
  
  for i in range(numbers):
  
      account=input()
  
      amount=eval(input())
  
      initial=BankAccount(account, amount)
  
      accountlist.append(initial)
  
      type=input()
  
      while type!='#':
  
          if type=='D':
  
              account=input()
  
              amount=eval(input())
  
              for i in range(len(accountlist())):
  
                  if(account==accountlist[i].getbankaccount()):
  
                      index=i
  
                      accountlist[index].Deposit(amount)
  
                      Print(amount, type, account)
  
          type=input()
  main()
  </code></pre>