赞
踩
好的,我有一个类型错误:“list”对象不可调用
它在下面的for循环中(如果type='D')
准确误差如下:Traceback(most recent call last):
file"test.py", line 55 in
main()
File "test.py", line 49, in main
for i in range(len(accountlist())):
TypeError: 'list' object is not callable
我的代码在下面,我试着将每个括号放在括号中,并将列表重命名为不同的名称,总是会遇到相同的错误。
我在这里做错什么了?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):
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。