小弟最近剛學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不能這樣用嗎
請問我錯在哪裡
謝謝各位