# Boolean¶

## Boolean Values¶

Boolean: the last of the simple ones

 >>> 1 < 2 True >>> 'X' == 'U' False  Values True and False Result of comparison operators Used with control flow statements (if, while) ⟶ later

## Boolean Operators¶

Usual operators

• L and R: True if both L and R evaluate to True

• L or R: True if L or R evaluate to True

• not X: True if X evaluates to False

Short circuit evaluation: operands are only evaluated until the expression’s value is clear

• L and R: if L is False, then the expression cannot become True anymore ⟶ R not evaluated

• L or R: if L is True, …

• ⟶ important when L, R are functions with side effects