Being contrary loses
Why it matters After one trap, it is tempting to treat every obvious answer as wrong. That is just a new default, and it is a worse one.
A shop page shows the three cheapest products in a category. Categories hold about 50 products. The team that owns this code reads it far more often than the computer runs it, so they keep a simplicity rule.
Read the rules, then pick the simplest thing that meets them.
Write cheapest_three(products): return up to three product dicts ({"name", "price"}) with the lowest prices, cheapest first; equal prices go in alphabetical order of name. Rule: your whole code may have at most 60 syntax nodes (code_size). Lists hold about 50 products.
Spotted a problem in this lesson? Report it · Ask about this lesson
This exercise opens soon
Finish the lesson before it and this one unlocks. The whole course is free, no account needed, and you can read this lesson right now.
This browser is blocking cookies for learn.floati.life, so lessons you finished here cannot open in order. Allow cookies for this site and reload.