I need to unshuffle function in Python. My code is:
def deshuffle_order(sftxt,order):
sftxt_out=[None]*len(sftxt)
for i, j in enumerate(order):
sftxt_out[j]=sftxt[i]
return sftxt_out
print(deshuffle_order('cbda',[2,1,3,0]))
I want the results of abcd
but when I run my code the output is ['a', 'b', 'c', 'd']