<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def access_key(root, key, sep='.', default=None):
    '''
    Look up a key in a potentially nested object `root` by its `sep`-separated
    path. Returns `default` if the key is not found.

    Example:
        access_key({'foo': {'bar': 1}}, 'foo.bar') -> 1
    '''
    props = key.split('.')
    props.reverse()
    while props and root:
        prop = props.pop()
        root = access(root, prop, default=default)
    return root