Python遇到TypeError:slice indices must be integers or None or have an index method的解决办法 代码如下图 错误原因 列表数据类型不是int 解决 将类型强制转换为int。 问题解决。 以上。