25 August 2026
Coupon Prices
Easy
Lists
Apply the same coupon to every price without creating negative prices.
You are given a list of whole-number prices and one coupon amount. For each price: - subtract the coupon - never return less than 0 - if the coupon is greater than or equal to the price, use 0 Return the new list of adjusted prices in the same order. If prices is empty, return an empty list.
Constraints
prices contains non-negative whole numberscoupon is a positive whole numberDo not change the original list
Function signature
def coupon_prices(prices, coupon):