Python:TypeError: unorderable types: int() < str()
来源:互联网 发布:长尾理论 知乎 编辑:程序博客网 时间:2024/06/09 16:44
>>> a=10>>> b=input()2>>> print(a<b)Traceback (most recent call last): File "<pyshell#51>", line 1, in <module> print(a<b)TypeError: unorderable types: int() < str()
上面的语句在Python2里面是可以执行的,但是在Python3里面会报错。原来,Python3里面input()默认的类型是string型。可以用int()将类型转化成integer型。
>>> a=10>>> b=input()2>>> print(a<int(b))False>>>
0 0
- Python:TypeError: unorderable types: int() < str()
- TypeError: unorderable types: str() > int()
- Python:unorderable types: str() > int()
- python3 调用heapq库 时遭遇 "TypeError: unorderable types"
- Python---TypeError: '<' not supported between instances of 'str' and 'int'
- Python字符串与数字拼接 TypeError: cannot concatenate 'str' and 'int' objects
- Python初学者错误:TypeError: unsupported operand type(s) for +: 'int' and 'str'
- python:字符串和数字拼接 (TypeError: Can't convert 'int' object to str implicitly)
- Python字符串与数字拼接报错解决TypeError: cannot concatenate 'str' and 'int' objects
- TypeError: '<' not supported between instances of 'str' and 'int'
- TypeError: unsupported operand type(s) for +: 'int' and 'str'
- python中的int与str
- python TypeError: 'int' object is not iterable
- Python:TypeError: 'int' object is not callable
- Python: TypeError: 'int' object is not callable
- python错误:TypeError: 'str' object is not callable
- Python报错TypeError: 'str' object is not callable
- Python 3 TypeError: ‘str’ does not support the buffer interface
- Spark算子系列文章
- GoldenGate安装、配置、实例化
- redis 安装 java 实例
- Android ViewPager实现无限循环(2.加入小圆点,优化自动和手动滑动冲突)
- LeetCode OJ-5.Longest Palindromic Substring(最长回文子串)
- Python:TypeError: unorderable types: int() < str()
- nodejs操作mysql数据库
- axel下载
- 设置圆形图片
- Python面向对象编程
- Android6.0 图像合成过程详解(二) doComposition函数
- 这篇文章对javascript函数部分说明很到位
- hibernate二级缓存
- Android 保存图片到SQLite,读出SQLite中的图片