How do I use a Boolean in Python?

后端 未结 7 1543
栀梦
栀梦 2020-12-02 12:31

Does Python actually contain a Boolean value? I know that you can do:

checker = 1
if checker:
    #dostuff

But I\'m quite pedantic and enjo

相关标签:
7条回答
  • 2020-12-02 13:35

    Unlike Java where you would declare boolean flag = True, in Python you can just declare myFlag = True

    Python would interpret this as a boolean variable

    0 讨论(0)
提交回复
热议问题