def kequivalent(springs, config):
    """
    Given a list of spring constant values and their configuration,
    returns the equivalent spring constant

    """
    if config == 'parallel':
        return sum(springs)
    elif config == 'series':
        return 1 / sum((1 / n for n in springs))
    else:
        raise ValueError('The given configuration is not supported: ' + config)