为何我这样写会报错?
Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> a=[]
>>> a[0]=1
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
a[0]=1
IndexError: list assignment index out of range
>>>