Loading

Python常见错误:IndexError: list index out of range

用python写脚本查询字典时,在遍历字典时循环到某一项时老是报错

 

出现这种错误有两种情况:

第1种可能情况

list[index]index超出范围

第2种可能情况
list是空值就会出现

IndexError: list index out of range

第二种情况尤为难以排除错误

posted @ 2018-10-27 00:02  维度Sec  阅读(54092)  评论(1编辑  收藏  举报