Boolean ¶
The next important data type in all programming languages is
bool
.
This just holds either the value
True
or
False
.
In [21]:
Copied!
print(type(True))
print(type(False))
print(type(True))
print(type(False))
<class 'bool'> <class 'bool'>
However, if we put double quotes around
True
or
False
it becomes a string.
In [22]:
Copied!
print(type("False"))
print(type("False"))
<class 'str'>