You cannot add the sums in place, as that will only work for the very first line of changes. You also need three separate statements for each column, as the sums are different. So first create a
deepcopy[
^] of the source array* and then do the calculations. Something like:
import copy
r,c=map(int,input().split())
arr=[list(map(int,input().split())) for row in range(r)]
answer = copy.deepcopy(arr)
for i in range(1, r):
answer[i][0] = arr[i-1][0] + arr[i-1][1]
answer[i][1] = arr[i-1][0] + arr[i-1][1] + arr[i-1][2]
answer[i][2] = arr[i-1][1] + arr[i-1][2]
print(F'{answer = }')
*this ensures you preserve row zero in the answer.