10

python3 出错求大神帮助list index out of range

代码部分
c_d = dict(zip(candidate,dist))
cd_sorted = sorted(c_d.items(), key=lambda d:d[1])
print ("\n The person is: " ,cd_sorted[0][0])
dlib.hit_enter_to_continue()

运行出错显示:

Traceback (most recent call last):
File "girl-face-rec.py", line 66, in
print ("\n The person is: " ,cd_sorted[1][5])
IndexError: list index out of range

帮忙看看问题出在哪里?

查看全部
baidu_41866771
baidu_41866771
2018/06/09 12:47
  • python
  • 点赞
  • 收藏
  • 回答
    私信

12个回复