Search RU
Tasks / pytest / Price filter
Statement easy

Price filter

`search(query, max_price)` returns a list of products. Write tests that check
that every product in the result costs no more than `max_price`.

**Example:**

```
search("бег", max_price=10000)
→ [{"name": "Run Fast", "price": 8990}, ...]
```

Cover the normal case, the boundary (a price exactly equal to `max_price`),
zero, and a negative price.

pytestassertedge cases
test_solution.py Python 3.14
AI mentor

The AI mentor is available after you log in: it sees your attempt history and does not spend resources on anonymous requests.

Log in and ask
Hints 1 of 3 unlocked · attempts: 0
Hint 1

Think about what should happen with a negative price: is it valid input, an empty
list, or an error? And what does "exactly `max_price`" mean — does the product
make the cut or not?

Hint 2 — unlocks after 1 attempt
Hint 3 — unlocks after 3 attempts