Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python '<';在';int';和';str';don';我甚至不知道要输出什么 ”_Python_Python 3.x - Fatal编程技术网

Python '<';在';int';和';str';don';我甚至不知道要输出什么 ”

Python '<';在';int';和';str';don';我甚至不知道要输出什么 ”,python,python-3.x,Python,Python 3.x,注意这行 TypeError: '<' not supported between instances of 'int' and 'str' 注意那条线 TypeError: '<' not supported between instances of 'int' and 'str' python中的input函数返回字符串对象。将int对象与str对象进行比较将引发TypeError(问题在于而(count

注意这行

TypeError: '<' not supported between instances of 'int' and 'str'
注意那条线

TypeError: '<' not supported between instances of 'int' and 'str'

python中的
input
函数返回字符串对象。将
int
对象与
str
对象进行比较将引发TypeError(问题在于
而(count
)将输入转换为int。
int(输入('set range:-'))
python中的函数返回字符串对象。将
int
对象与
str
对象进行比较将引发TypeError(问题在
而(计数
)将输入转换为int。
int(输入('set range:-'))
TypeError: '<' not supported between instances of 'int' and 'str'
count < n
n = int(input("set range:- "))