问题
>>> data=[]
>>> list1.append(data[14])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: list index out of range
——list index out of range ,在上述例子中,原因是要添加的数据是空的。
>>> data=[]
>>> list1.append(data[14])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: list index out of range
——list index out of range ,在上述例子中,原因是要添加的数据是空的。