簡體   English   中英

如何解決此 TypeError:在 python 中的“NoneType”和“int”實例之間不支持“>”

[英]How to solve this TypeError: '>' not supported between instances of 'NoneType' and 'int' in python

我使用在線提到的所有技術來解決以下錯誤“TypeError:'>'在'NoneType'和'int'的實例之間不受支持”但失敗了。

這是我的代碼

---
def checkfun()
    ---
    if (CheckBottomYCoVaring(length) == True):
    ---

def CheckBottomYCoVaring(length):
    result = False
    if (TempBotY > PrevbottomY[length]):
        if (TempBotY - PrevbottomY[length]) < 3:
            result = True
        else:
            result =  False
    else:
        if (PrevbottomY[length] - TempBotY) < 3:
            result = True
        else:
            result = False
    return result

TempBotY 的值為 None

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM