I need to define a function apply(L, P) where L is a list and P is a permutation, and it should return the list L o P. Assume len(L) = len(P)
What I've got so far is
import itertools
def apply(L, P):
for perm in L:
return perm
An example of input is apply(['ah', 'boo', 'cc', 'du', 'eh'], [1, 4, 3, 2, 0])
But the only output from that is 'ah'
Any help would be great.