Skip to content

Commit 29b569d

Browse files
author
codehouseindia
authored
Merge pull request codehouseindia#297 from sumansaurav143/patch-1
Matrix Transpose using Nested Loop
2 parents 97ede1e + 3bd9965 commit 29b569d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Transpose a Matrix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
X = [[12,7],
2+
[4 ,5],
3+
[3 ,8]]
4+
5+
result = [[0,0,0],
6+
[0,0,0]]
7+
8+
for i in range(len(X)):
9+
for j in range(len(X[0])):
10+
result[j][i] = X[i][j]
11+
12+
for r in result:
13+
print(r)

0 commit comments

Comments
 (0)