问答详情
源自:9-5 Python函数参数

or的用法是不是有问题,因为没有一个数既是int 又是float

if not isinstance(x, int) or not isinstance(x, float)

提问者:慕婉清4134424 2025-10-23 22:42

个回答

  • 星芒k
    2025-10-31 14:24:01

    int或float,只要满足其中一个条件就是True,一真则真,假假才假