List transormation

Dale Strickland-Clark dale at out-think.NOSPAMco.uk
Tue Sep 19 12:39:18 EDT 2000


Sorry,
I should have mentioned that I've already come up with this but I thought
there might be a neater way:

z = []
for i in y:
   z.append(x[i])


--
Dale Strickland-Clark
Out-Think Ltd, UK
Business Technology Consultants

Dale Strickland-Clark <dale at out-think.NOSPAMco.uk> wrote in message
news:3EKx5.23978$Lu3.424916 at east7.usenetserver.com...
> Before I waste too much time on this, reinventing the wheel, is there a
> quick way to reorder the items in a list under the control of another
list?
>
> e.g..
>
> x = ['kipper', 'my', 'a', 'nose', 'is']
> y = [1, 3, 4, 2, 0]
>
> y transforms the order of x to produce:
>
> ['my', 'nose', 'is', 'a', 'kipper']
>
> Thanks
>
> --
> Dale Strickland-Clark
> Out-Think Ltd, UK
> Business Technology Consultants
>
>
>
>
>
>






More information about the Python-list mailing list