Within the context of this exercise, can boolean expressions be combined into a longer expression?
Yes, we can combine multiple boolean expressions together to form a longer expression. For example, if we had the expressions,
Penguins are birds.
Penguins cannot fly.
we can combine them into a longer expression, either using an
and operator which will be covered in the later exercises, resulting in
Penguins are birds AND Penguins cannot fly.
If we evaluated this for say an
if statement, then this would become
True and True = True
and we might print out “Penguins are flightless birds” inside the
if statement body.
This general idea is what we apply to boolean expressions in Python to combine multiple expressions together.