Skip to content
小飞侠
  • 首页
  • 小程序
  • uniapp
  • vue
  • APICloud
  • 其他
菜单

博客

  1. 首页>
  2. python>
  3. python 出现的问题:TypeError: ‘float’ object cannot be interpreted as an integer

python 出现的问题:TypeError: ‘float’ object cannot be interpreted as an integer

  • Post author:xfxia
  • Post published:2023年8月24日
  • Post category:python


python2的规则中,“/”是取整,是int型

而在python3中,“/”符号是保留小数的,是float型

解决:改为“//” 即可



版权声明:本文为m0_38133212原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/m0_38133212/article/details/99443236

你可能也喜欢

Python-Bubble Sort

Python QT与Opencv(一)

python strip函数

tensorflow的python版本之truncated_normal

Python:字符串中的方法–strip()

python——正则表达式

python程序调试和异常处理

python的roc曲线与阈值_Roc曲线和切断点.Python

python 取出文件路径、文件名的各种常用操作

python解LeetCode 27. 移除元素

如何学习Python开源项目代码

python检测图片相同部分_用 Python 实现哈希算法检测重复图片

python–str.split()函数分割

python进阶:7招展开嵌套列表

python程序中用类变量代替global 定义全局变量

Python eval()和exec()函数详解

LeetCode202.快乐数(Python)

Python ndarray padding

Python函数和函数嵌套、闭包、递归、匿名详细讲解(三)

jenkins使用python脚本发送企业微信通知

目录

  • APICloud (3)
  • golang (228)
  • java (8,236)
  • linux (4,002)
  • mysql (2,800)
  • php (1,070)
  • python (5,439)
  • solidity (25)
  • uniapp (235)
  • vue (2,463)
  • 其他 (88,233)
  • 小程序 (801)

文章归档

  • 2023年十二月 (1872)
  • 2023年十一月 (477)
  • 2023年十月 (17371)
  • 2023年九月 (44974)
  • 2023年八月 (26399)
  • 2023年七月 (14793)
  • 2023年六月 (1)
  • 2023年五月 (2186)
  • 2023年四月 (3838)
  • 2023年三月 (1544)
  • 2023年二月 (3)
  • 2023年一月 (4)
  • 2022年十二月 (3)
  • 2022年十一月 (36)
  • 2022年十月 (16)
  • 2022年九月 (8)
  • 2021年九月 (1)
  • 2020年九月 (6)
  • 2020年八月 (5)

标签

Aave (1) cosmos (6) defi (255) flag (27) gitee (1) github (1) golang (234) java (8234) linux命令 (82) List (1) map (1115) mysql (3093) npm (237) tendermint (6) uuid (43) vant (64) vmware (270) 区块链 (63) 合约 (37) 小程序版本更新 (3)
  • 首页
  • 小程序
  • uniapp
  • vue
  • APICloud
  • 其他
Copyright xfxia.com 鲁ICP备19024253号-2
关闭菜单