def transpose(matrix):
#FOLLOWING is my code, it is incorrect however. COULD ANY GIVE ME A HAND?
O(∩_∩)OThanks :)
l=len(matrix)
i=0
j=0
Aj=[]
T=[]
for i in range(l):
Ai=matrix
li=len(Ai)
i+=1
for j in range(li):
Aij=Ai[j]
j+=1
for i in range(l):
Aj.append(Aij)
i+=1
for j in range(li):
T.append(Aj)
j+=1
return T
JasonQiao
0
Newbie Poster
Recommended Answers
Jump to PostI've added some notes on what is and is not happening. When you don't understand something it is usually good to break it into smaller pieces and solve each piece individually. This code is not even good enough to correct so start again and post back, next time include an …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.