def r_size(x):
    """Returns the difference between the largest and smallest value in a collection.

    Parameters
    ----------

    x : collection of numbers
    
    Examples
    --------

    >>> r_size([2,4,6,8])
    6

    >>> r_size({3,6,9,11})
    8

    """
    return max(x) - min(x)