How do I achieve the effect of the === operator in Python?

前端 未结 4 1321
轮回少年
轮回少年 2021-01-11 12:22

How do I achieve the effect of the === operator in Python?

For example, I don\'t want False == 0 to be True.

4条回答
  •  耶瑟儿~
    2021-01-11 12:47

    You can use the is operator to check for object identity. False is 0 will return False then.

提交回复
热议问题