If we try to fetch the value of a key that does not exist, we get an exception.

examples/dictionary/no_such_key.py
from __future__ import print_function

user = {
    'fname': 'Foo',
    'lname': 'Bar',
}

print(user['fname'])
print(user['email'])

# Foo
# Traceback (most recent call last):
#   File "examples/dictionary/no_such_keys.py", line 9, in <module>
#     print user['email']
# KeyError: 'email'

Unless we use the get method, in which case we get None

examples/dictionary/get_key.py
#!/usr/bin/env python

user = {
    'fname': 'Foo',
    'lname': 'Bar',
}

print user.get('fname')
print user.get('email')

# Foo
# None

None will be interpreted as False, if checked as a boolean.