热线电话:13121318867

登录
2018-10-24 阅读量: 849
python 错误解析

代码如下:

>>> t = ()  
>>> t[0]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: tuple index out of range

>>> l = []
>>> l[0]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: list index out of range

【错误分析】空元祖和空列表,没有索引为0的项

0.0000
2
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子