Python - Booleans

python logo pixel art

The boolean data can only be true or false.


isPython = True
isC = False

Some data is False!

bool(0)
bool("") # <- empty string
bool([]) # <- empty array
bool(()) # <- empty tuple
bool({}) # <- empty dictionary, set
bool(None)
data = []
if not data:
  # will execute
  pass