Добавлена функция filter_by_price_threshold
This commit is contained in:
parent
94d132aa97
commit
cf16f9915a
@ -91,3 +91,11 @@ def apply_discount(orders: list[dict], discount_percent: float) -> list[dict]:
|
|||||||
new_order['total'] = order['total'] * (1 - discount_percent / 100.0)
|
new_order['total'] = order['total'] * (1 - discount_percent / 100.0)
|
||||||
discounted_orders.append(new_order)
|
discounted_orders.append(new_order)
|
||||||
return discounted_orders
|
return discounted_orders
|
||||||
|
|
||||||
|
|
||||||
|
# 7. Фильтрация товаров по минимальной цене за единицу
|
||||||
|
def filter_by_price_threshold(orders: list[dict], min_price: float) -> list[dict]:
|
||||||
|
"""
|
||||||
|
Возвращает заказы, у которых price >= min_price.
|
||||||
|
"""
|
||||||
|
return [order for order in orders if order['price'] >= min_price]
|
||||||
Loading…
Reference in New Issue
Block a user