Exercise: Dictionary: Errors?¶
In the interactive interpreter, create a dictionary like so:
>>> d = {
... 'one': 1,
... 'two': 2,
... }
>>> d['one']
1
What happens if you access a non-existent key?
>>> d['three']
In the interactive interpreter, create a dictionary like so:
>>> d = {
... 'one': 1,
... 'two': 2,
... }
>>> d['one']
1
What happens if you access a non-existent key?
>>> d['three']