标题: TypeError: unorderable types: str() < int() [打印本页] 作者: zfr007zfr 时间: 2018-8-28 14:14 标题: TypeError: unorderable types: str() < int() import random
s = random.randint(0, 9)
n = input('请输入猜的数字>>')
if n <10 and n >=0:
pass
else:
print('请输入0-9的整数')
if n == s:
print('恭喜')
else:
print('猜错了,正确答案是',s)
Traceback (most recent call last):
File "D:\python\python temp.py", line 4, in <module>
if n <10 and n >=0:
TypeError: unorderable types: str() < int()