- 新建空列表的时候,在后续的程序之中不能用下标给列表赋值,例如:
len=[]
len[0]=5
此时就会报错:IndexError: list assignment index out of range
但是我们可以用len.appended(5)来给列表自增
python错题笔记
猜你喜欢
转载自blog.csdn.net/weixin_42595206/article/details/103495204
今日推荐
周排行