##2020.07.02 python学习日记##
- IndexError: list assignment index out of range
空列表不能通过索引值添加内容
User=[]
for i in range(0, n):
User[i]={}
解决办法:
零列表占位
User = [0 for _ in range(n)]
for i in range(0, n):
User[i]={}
User=[]
for i in range(0, n):
User[i]={}
解决办法:
零列表占位
User = [0 for _ in range(n)]
for i in range(0, n):
User[i]={}