[Tutor] reassign

Tim Golden mail at timgolden.me.uk
Sun Apr 8 11:54:43 CEST 2007


linda.s wrote:
> Hi,
> I have a list: [2,5,8,0,1,7]
> how i can randomly reassign the values to different location in the list?
> for example:
> Time 1: [5,2,8,0,1,7]
> Time 2: [8,0,7,1,5,2]
>   
Have a look at the .shuffle function in the random module.

TJG


More information about the Tutor mailing list