= True
cache
if cache:
print('data will be cached')
data will be cached
Programming for Data Science
A boolean
value takes one of True
or False
, which are built-in values
check if cache
is True, using if
statement
if
statement using a bool evaluates to True or False
Booleans are frequently used in if/then
statements.
We’ll cover these later.
AND statements will short circuit if an early condition fails.
In this case, since oome is False, the check on cache never happens.