I've composed a code to transpose a 2d array in Python but it doesn't work correctly and all rows of the transposed array are similar to last column of the original array. Can anybody help me to find out the problem?
a = [[1, 3, 2],
[6, 7, 3],
[2, 0, 1],
[9, 0, 4]]
b = [[*range(len(a))]] * len(a[0])
for i in range(len(a)):
for j in range(len(a[0])):
b[j][i] = a[i][j]
print(a)
print(b)