def nested_dict(opts, value):
    """create a nested dictionary given a list of keys and a value
    """

    if len(opts) > 1:
        return {opts[0]: nested_dict(opts[1:], value)}
    elif len(opts) == 1:
        return {opts[0]: value}
    else:
        ValueError