TypeError: list indices must be integers or slices, not str

“TypeError: list indices must be integers or slices, not str”有关报错解决方案

在学习python中遇到了提示“TypeError: list indices must be integers or slices, not str”报错。查询资料后得到了解决

TypeError: list indices must be integers or slices, not str

在这里插入图片描述
这里的提示意思是list的索引必须是整数或者片,而不是str
通过调试我的代码发现,我这里的datas中的数据是如下图所示

posted @ 2021-02-20 17:23  竹石2020  阅读(617)  评论(0)    收藏  举报