Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Boolean (logical) operations

TRUE & TRUE     # TRUE
TRUE & FALSE    # FALSE

TRUE | FALSE    # TRUE
FALSE | FALSE   # FALSE

! TRUE          # FALSE
! FALSE         # TRUE



# Logical Operations
a = TRUE
b = FALSE

a & b  # logical AND    FALSE
a | b  # logical OR     TRUE
! a    # logical NOT    FALSE

x = 2
y = 4
x & y   # TRUE
x & 0   # FALSE

print(2 & 4)  # TRUE
print(2 & 0)  # FALSE
print(2 | 0)  # TRUE