I've got this function that removes the second data value from a list (simplified). However when executing the function, the original list seems to get modified even though I'm only doing something to the variable inside the function.
print(data_values)
def remove_2(data):
data.pop(2)
return data
new_data = remove_2(data_values)
print(data_values)
>>>['a', 'b', 'c', 'd']
>>> ['a', 'b', 'd']
I'm printing out the original data_values both times, but the second time it's the modified version even though only the variable inside the function was modified.