-
defaultdictwill automatically create a dictionary for you that has keys which are the integers 0-10. -
defaultdictforces a dictionary to only accept keys that are of the data type specified when you created thedefaultdict(such as strings or integers). - If you try to read from a
defaultdictwith a nonexistent key, a new default key-value pair will be created for you instead of throwing aKeyError. -
defaultdictstores a copy of a dictionary in memory that you can default to if the original gets unintentionally modified.
Correct Answer:
- If you try to read from a
defaultdictwith a nonexistent key, a new default key-value pair will be created for you instead of throwing aKeyError.