M8) Replacing negative values

The four versions of remove_negatives in Listing 1 should:

  1. Receive a list of integers.
  2. Return a new list of the same length with each negative value replaced by 0.

The input list must remain unchanged. For example, if numbers is [1, -2, 3, -4, 5], the function should return [1, 0, 3, 0, 5] while numbers remains [1, -2, 3, -4, 5].

Which implementation of the remove_negatives function in Listing 1 correctly returns the required copy without modifying the input list?

Listing 1: Alternatives for the remove_negatives function that returns a copy of a list with the negative values replaced by zero (Question 1).
(a)
def remove_negatives(numbers):
    # Build the list to return.
    result = []

    for number in numbers:
        if number < 0:
            result.append(0)
        else:
            result.append(number)

    return result
(b)
def remove_negatives(numbers):
    # Build the list to return.
    result = []

    for i in range(len(numbers)):
        if numbers[i] < 0:
            numbers[i] = 0

    return result
(c)
def remove_negatives(numbers):
    # Build the list to return.
    result = []

    for i in range(len(result)):
        if numbers[i] < 0:
            result.append(0)
        else:
            result.append(numbers[i])

    return result
(d)
def remove_negatives(numbers):
    # Build the list to return.
    result = []

    for number in numbers:
        if number < 0:
            result.append(0)

    return result