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

def getpath(d, json_path, default=None, sep='.'):
    '''Gets a value nested in dictionaries containing dictionaries.
    Returns the default if any key in the path doesn't exist.
    '''
    for key in json_path.split(sep):
        try:
            d = d[key]
        except (KeyError, TypeError):
            return default
    return d