小编Kir*_*aya的帖子

为什么无论我使用哪种类型,我的代码总是显示“small int”?

def check_it(probe):
    if probe is str:
        return ("a string")
    
    elif probe is int and probe > 100:
        return ("large int")
    else:
        return ("small int")
    
print(check_it("hi"))
Run Code Online (Sandbox Code Playgroud)

python

1
推荐指数
1
解决办法
42
查看次数

标签 统计

python ×1