apply Permutation cycles to a letters list
Hi
Sorry for this very basic question, but how to apply the Permutation function to a list of letters ? I think it should exist a simplest way than the the cooking below. I searched the web, without success !
def applyGen(ge,dic) :
return [ge[dic.get(e)] for e in dic.keys() ]
def decrement_dic(dic):
return {k - 1: v - 1 for k, v in dic.items()}
lettersL=['a','b','c','d','e','f','g','h']
test=Permutation((1,5,8,4),(2,6,7,3))
dicD=decrement_dic(test.dict())
applyGen(lettersL,dicD)