def range_squared(n):
    """A function range_squared(n) that takes an non-negative integer value
    n and returns the list [0, 1, 4, 9, 16, 25, ..., (n-1)^2]. If n is zero,
    the function should return the empty list."""
    if n > 0:
        return [i ** 2 for i in range(n)]
        # return list(map(lambda x: x ** 2, range(n)))
    elif n == 0:
        return []
    else:
        return "Error: n must be zero or a positive integer."