o is the standard of pattern to un_shuffle
o = [2,1,3,0] a = 'abcd' def un_suffle(s,o): s = 'bcda' return ''.join([s[i] for i in o]) print(un_suffle(s,o))
my output is:
dcab # i want to make it abcd in output
Aucun commentaire:
Enregistrer un commentaire