2020-05-18
阅读量:
697
python报错:IndexError: list index out of range
问:
python报错:IndexError: list index out of range,是什么原因?

答:
这是因为L的索引超出范围,L是[1, 2, 3, 4, 5, 6, 7, 8, 9]共9个数,L[i]设置的遍历范围为L[1]-L[9],L[9]超出范围不存在便会报错。






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
3条评论