我得從迴路列表最小值,但我得到一個錯誤:最小值值
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