运行 ❯
获取您自己的
Python
服务器
×
更改方向
更改主题,深色/浅色
转到 Spaces
# (x > 3) will raise an error because x is a string and 3 is a number, and cannot be compared using a '>': x = "hello" try: x > 3 except NameError: print("You have a variable that is not defined.") except TypeError: print("You are comparing values of different type")
您正在比较不同类型的值