TypeError: ‘<‘ not supported between instances of ‘NoneType‘ and ‘int‘

错误复现

# python代码
None < 1

报错:

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

报错表明了Noneint不能做大小比较,编程时候需要注意排除这种情况。

猜你喜欢

转载自blog.csdn.net/shiyuzuxiaqianli/article/details/112069222