python中布尔值
What is Boolean?
什么是 布尔值?
It is just an integer that can have 1 ,0,-1 or floats like 0.32, 3.32 etc. The output of the decisions can be true or false.
它只是一个整数,可以具有1,0,-1或浮点数,例如0.32、3.32等。决策的输出可以为true或false。
In many cases during writing code or implementing any comparison to consider any decision we usually use boolean in any programming language.
在许多情况下,在编写代码或进行任何比较以考虑任何决定时,我们通常在任何编程语言中都使用布尔值。
Here we will see some basic examples on how we can use them on Python. Before we use it let us see the type of True and False.
在这里,我们将看到一些有关如何在Python上使用它们的基本示例。 在使用它之前,让我们看一下True和False的类型。
print type(True)
print type(False)