Python Foundations · Lesson 5 of 12Boolean logic
Combining conditions with and, or and not. Learn through short examples, practical tasks and targeted questions.
← All lessons
Combining Boolean conditions
The operators and, or and not combine or reverse conditions. They are useful for age checks, passwords and deciding whether several requirements have been met. Create a truth table to predict the result before running the code.
Watch out: With and, both conditions must be true; with or, at least one must be true. Be careful when using not with compound expressions.
A free TutorSyntax programming lesson. About our teaching approach.