0 of 6 problems solved • 0%

Dictionaries

6 exercisesIntermediate

A dictionary associates each unique key with a value. Keys can name products, and values can store their available quantities. Use assignment to insert or update a key.

prices = {"pear": 3} prices.get("plum", 0) # 0 prices["pear"] = 4