Sale on the Big Stuff

Python for AIMedium+10 XP+10

Sale on the Big Stuff

A shop is running a sale: every item priced above a limit gets 20% off. Items at or below the limit aren't part of the sale.

Write sale_prices(prices, limit). It returns a new list holding only the sale items, each at its reduced price (price * 0.8), in their original order.

An item priced exactly at limit is not included. If nothing is above the limit, return an empty list.

Examples

prices = [10, 50, 30]
limit = 20
returns [40.0, 24.0]
prices = [5, 8]
limit = 10
returns []

Hints

Solve it to unlock the solution

Once your code passes every test, a reference solution shows up here so you can compare it with yours.

solution.py
CtrlEnterto run