Question 1 of 5
For a key that is not in the dictionary, what is the difference between
prices.get("rye") and
prices["rye"]?
Choose between brackets and get with a reason, the quick check says.
Brackets on a missing key raise KeyError, stopping the program, while get returns a default you may pass, or None, and keeps walking. get is for absent being normal; brackets are for absent being a bug worth stopping for.
Review this lesson