So bascially I want to have one array(result) to which I add sum of the second array (array) but when I try to add to result sum of array it adds to array what should be added to result
def some_function(signature, n):
array = result = signature
count = 1
while count <= n:
print(array) # prints [1, 1, 1]
result.append(sum(array)) # Here i don't get it why result.append modifies array.
# Without result.append everything works fine
print(array) # prints [1, 1, 1, 3]
array.append(sum(array))
print(array) # prints [1, 1, 1, 3, 6]
del array[0]
count += 1
return result
print(some_function([1, 1, 1], 10))