error: new_values and values were pointing to the same object in memory. Thus a modification of new_values (in this case: append) did also change values as it modifies the object both new_values and values are pointing to. Fix: Make new_values a deep copy of values at the beginning. Import deepcopy from copy.
error: new_values and values were pointing to the same object in memory. Thus a modification of new_values (in this case: append) did also change values as it modifies the object both new_values and values are pointing to. Also, the difference was -0.625 Fix: Make new_values a deep copy of values at the beginning. Import deepcopy from copy. Exchange values and new_values at print to get a positive result.