Your question is Simple Price Word Problem. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Sparrow Foundation maintains a small produce price catalog. Given a dictionary mapping fruit names to prices in cents and a requested fruit name, return that fruit's price.
Implement fruit_price(prices, fruit). The requested fruit is guaranteed to exist in the catalog, so no missing-key behavior is required.
prices, a dictionary whose keys are lowercase fruit names and whose values are non-negative integer prices in cents; fruit, a lowercase string.fruit.def fruit_price(prices, fruit):