I want to transpose a list of strings but I get TypeError

Viewed 3868

suppose I have this list of strings

li=['efh','opd','qst']

I want to "transpose" them so they look like this

li=['eoq','fps','hdt']

Here's the code I proposed but I get a typeError

previous=''

for i in range (len(li)):
    for j in range (len(li[0])):
        list2[j][i]=previous+list[i][j]
        previous=list2[j][i]
    previous=''
2 Answers
Related