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

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

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

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

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

猜你喜欢

转载自blog.csdn.net/qq_40284566/article/details/80950611