Create_3D(H,W,D) Description: It creates a list of list of list of ints (i.e. a 3D matrix) with dimensions HxWxD. The value of each item is the sum of its three indexes. Parameters: H (int) is the height, W (int) is the widht, D (int) is the depth Return value: list of list of list of int Example: create_3D(2,3,4) → [[[0,1,2],[1,2,3]], [[1,2,3],[2,3,4]], [[2,3,4],[3,4,5]], [[3,4,5],[4,5,6]]] copy_3D(xs) Description: It creates a deep copy of a 3D matrix xs. Make sure the copy you make is not an alias or a shallow copy. Parameters: xs (list of list of list of int)

Respuesta :

Answer:

See explaination for the details.

Explanation:

Code:

def create_3D(H, W, D):

result = []

for i in range(D):

result.append([])

for j in range(H):

result[i].append([])

for k in range(W):

result[i][j].append(i+j+k)

return result

print(create_3D(2, 3, 4))

Check attachment for onscreen code.

Ver imagen kendrich