← Questions

Shipping cost with tiered pricing

0
StripeCodingLast asked Jan 2026

An order names a country and the products and quantities in it, and a pricing table gives the shipping cost of each product for each country.

  1. Compute the order's total shipping cost when every product has a fixed price per unit.
  2. Prices become tiered: units in different quantity ranges cost different amounts.
  3. Some tiers become a flat fee covering the first units instead of a per-unit price.

Get the tier boundaries right.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding