Chinaunix首页 | 论坛 | 博客
  • 博客访问: 111813
  • 博文数量: 28
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 277
  • 用 户 组: 普通用户
  • 注册时间: 2014-10-20 16:21
文章分类
文章存档

2019年(1)

2018年(2)

2017年(22)

2016年(3)

我的朋友

分类: 系统运维

2017-12-28 10:39:57

1、IndexError: list index out of range


第1种可能情况
list[index]index超出范围

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

2、IndentationError:expected an indented block


在编译时会出现这样的错IndentationError:expected an indented block说明此处需要缩进,你只要在出现错误的那一行,按空格或Tab(但不能混用)键缩进就行。

我遇到这个报错的原因不是缩进,是if语句下为空,为空时要写continue,不然会报这个错。
阅读(1772) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~