# Exercise - Use 'and' and 'or' operators

## Exercise - Use complex logic to determine possible evasive maneuvers

In the previous exercise you created code to test the size of the object. Now you will test both the object's size and proximity. You will use the same threshold for size of 5 m3. If the object is both larger than the threshold and within 1000km of the ship evasive maneuvers will be required.&#x20;

For this step you will be presented with the goal for the exercise, followed by an empty cell. Enter your Python into the cell and run it. The solution is at the bottom of the exercise.&#x20;

Add the code to the cell below to create two variables: `object_size` and `proximity`. Set `object_size` to `10` to represent 10 m3. Set `proximity` to `9000`.

Then add the code to display a message saying **Evasive maneuvers required** if both `object_size` is greater than 5 and `proximity` is less than 1000. Otherwise display a message saying **Object poses no threat**.

```python
object_size = 10
proximity = 9000
if object_size > 5 and proximity < 1000:
    print ('Evasive Maneuvers required')
else:
    print ('Object poses no threat')
```

## Desired output

```
Object poses no threat
```


---

# 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/exercise-use-and-and-or-operators.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.
