# Summary

By using test expressions, otherwise known as Boolean expressions, you can conditionally run Python code. They're commonly used in Python to 'make decisions' about what should happen next while a program is running. In the earlier units, you wrote test expressions as part of `if`, `else`, and `elif` statements, and you further fine-tuned your conditions by using the operators `and` and `or`.&#x20;

Boolean expressions and statements are a key part of creating complex Python programs, where you want your code to run only under certain conditions.

Here are some fo the essentials you now know about conditional logic:

* Booleans can have one of two values, `True` or `False`.&#x20;
* if, else and elif statements can be used to run code under specific conditions.
* `and` and `or` operators can be used to combine test expressions and create more complex conditions.

With these tools, you should feel ready to write more complex code blocks in Python


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.pqtkha.com/programming/technology/python/microsoft-training-python-for-beginners/module-2-use-boolean-logic-in-python/summary.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
