import copy def ct4(L, A, n): A[0][0] += n A[1] += [10*n] L.append(n) def findVs(L): rows = len(L) cols = len(L[0]) for row in range(rows): for col in range(cols): if (L[row][col] == 1 and L[row+1][col+1]==1 and (L[row][col+2])==1): return (row, col) def testZeroRectCount(): print('testing findVs...') L = [[0, 0, 0, 0], [1, 0, 1, 0], [0, 1, 0 ,0], [0, 0, 0, 0]] assert(findVs(L) == (1, 0)) print('Passed!') def main(): print('------------------------------------------------------------') testZeroRectCount() # Be careful to get the brackets and commas right! L = [[1], [2]] C = copy.copy(L) D = copy.deepcopy(L) ct4(L, C, 1) ct4(L, D, 2) print(L) main()