TypeError: tuple indices must be integers or slices, not float 问题解决 报错问题指的是元组数据必须是整型或者切片,不能为浮点型 解决方法 如果原来代码中使用了浮点数除法‘/’,返回浮点结果 将其修改为" // "整数除法 重新运行程序,问题解决