小弟最近刚学python 对于python很不熟悉
想写一个可以存很多Account的class
class Account:
def __inti__(self, number, name, deposit, address):
self.account_id = number
self.account_name = name
self.deposit = deposit
self.address = address
acct = []
i = 0
acct[i].Account(number,name,deposit,address)
为什么他说acct[i].Account(number,name,deposit,address)这行
IndexError: list index out of range
list不能这样用吗
请问我错在哪里
谢谢各位