Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Like this

sage: L=['a','b','c','d','e','f','g','h']
....: test=Permutation((1,5,8,4),(2,6,7,3))
sage: [lettersL[test(i+1)-1] for i in range(len(L))]
['e', 'b', 'c', 'a', 'h', 'f', 'g', 'd']

Note that Python numbering starts from 0.

Like this

sage: L=['a','b','c','d','e','f','g','h']
....: test=Permutation((1,5,8,4),(2,6,7,3))
L = ['a','b','c','d','e','f','g','h']
sage: [lettersL[test(i+1)-1] test = Permutation((1,5,8,4),(2,6,7,3))
sage: [lettersL[test(i + 1) - 1] for i in range(len(L))]
['e', 'b', 'c', 'a', 'h', 'f', 'g', 'd']

Note that Python numbering starts from 0.

Like this

sage: L = ['a','b','c','d','e','f','g','h']
sage: test = Permutation((1,5,8,4),(2,6,7,3))
sage: [lettersL[test(i [L[test(i + 1) - 1] for i in range(len(L))]
['e', 'b', 'c', 'a', 'h', 'f', 'g', 'd']

Note that Python numbering starts from 0.