我得从回路列表最小值,但我得到一个错误:最小值值
Python 3.5.2 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux
Traceback (most recent call last):
File "python", line 6, in <module>
TypeError: unorderable types: int() < NoneType()
这里是我的代码:
tab = [1,2,3,4, None, None, None]
min_value = None
for i in tab:
if i:
if int(i) < min_value:
min_value = i
print(min_value)
可能的复制[类型错误(unorderable类型:INT()<= NoneType())](http://stackoverflow.com/questions/23364190/typeerror-unorderable-types-int-nonetype) – lubilis
什么结果你期望从int与'None'进行比较吗? – khelwood