boolean
instance of bool class. Only True or False. It is often used when checking whether expression is truthy or falsy.
python
print(100 > 39) # True
print(-1 > 0) # True
print('long text' > 'short') # True
print([1,2,3] == [1,2,3])
# True
# even they are separate objectconversion to boolean
using bool()
python
print(bool(5)) # True
print(bool(0)) # False
print(bool(0.0)) # False
print(bool('abc')) # True
print(bool('')) # Falsenegate boolean
using not
python
is_available = True
print(not is_available) # False