The problem happens in the nested loop. In the first iteration everything is fine. The 2nd iteration over i, modifies the first list too and so on. Zeros across the 2d list should be diagonal
import math
def calcpyth(p1, p2):
distance = math.sqrt(((p1[0] - p2[0]) ** 2) + ((p1[1] - p2[1]) ** 2))
return distance
tuple0 = (42, 288)
tuple1 = (45, 326)
tuple2 = (50, 364)
tuple3 = (57, 400)
list = [tuple0, tuple1, tuple2, tuple3]
zeros = [[0]*len(list)]*len(list)
test = zeros
for i in range(len(test)):
for j in range(len(test)):
test[i][j] = calcpyth(list[i], list[j])