成功解决TypeError: 'float' object cannot be interpreted as an integer

简介: 成功解决TypeError: 'float' object cannot be interpreted as an integer

解决问题


TypeError: 'float' object cannot be interpreted as an integer



解决思路


类型错误:“float”对象不能解释为整数



解决方法


python2和python3中运算符的区别

查看代码中是否含有/,

python3的/结果含有浮点数!

python2中的/等价于python3的//

在python3中,//表示取整除 - 返回商的整数部分(向下取整)


print(5/2,5//2)  #输出2.5 2




 


相关文章
|
1月前
|
Java 测试技术 数据库
hql投影查询之—— [Ljava.lang.Object; cannot be cast to cn.bdqn.guanMingSys.entity.Notice
hql投影查询之—— [Ljava.lang.Object; cannot be cast to cn.bdqn.guanMingSys.entity.Notice
11 0
|
5月前
libfreetype.so.6: cannot open shared object file: No such file or directory
libfreetype.so.6: cannot open shared object file: No such file or directory
156 0
|
机器学习/深度学习 Linux
解决ImportError libgmpxx.so.4 cannot open shared object file No such file or directory
解决ImportError libgmpxx.so.4 cannot open shared object file No such file or directory
176 0
解决ImportError libgmpxx.so.4 cannot open shared object file No such file or directory
|
2月前
|
Java
cannot open shared object file: No such file or directory
cannot open shared object file: No such file or directory
22 0
|
4月前
FeignClient【问题】Cannot deserialize value of type``from Object value (token `JsonToken.START_OBJECT`)
FeignClient【问题】Cannot deserialize value of type``from Object value (token `JsonToken.START_OBJECT`)
200 0
|
4月前
|
Java
cannot open shared object file: No such file or directory
cannot open shared object file: No such file or directory
35 0
|
5月前
|
NoSQL MongoDB
mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No s
mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No s
143 0
|
5月前
gdalinfo: error while loading shared libraries: libgdal.so.30: cannot open shared object file: No su
gdalinfo: error while loading shared libraries: libgdal.so.30: cannot open shared object file: No su
|
5月前
|
关系型数据库 MySQL
mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such
mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such