**Python错误记录:IndexError: list index out of range**

来源:互联网 发布:js定时器累加 编辑:程序博客网 时间:2024/06/06 01:45

Python错误记录:IndexError: list index out of range

刚开始做自动化测试,遇到这个问题IndexError: list index out of range
百度一下找到了答案,我只是整理一下

这个错误出现大约有两种情况:
第1种可能情况
list[index]index超出范围

第2种可能情况
list是一个空的 没有一个元素
进行list[0]就会出现该错误

0 0
原创粉丝点击