Random List Loop?!

Oscar Benjamin oscar.j.benjamin at gmail.com
Sat Jan 5 11:02:18 EST 2013


On 5 January 2013 15:47, Christian Gabriel <gabrieldenmark at gmail.com> wrote:
> Hi
>
> I have tried now for ages to make a loop that does the following:
>
> Makes a new list with 9 random values, from 9 different lists, with 9 elements.
>
> And makes sure that none of the elements repeat!
>
> Is there anyone that can help, with a very simple solution??

I'm sure that there is a simple solution but I don't fully understand
your problem could you perhaps provide an example with actual numbers
(perhaps use 3 instead of 9 so it's easier to follow)?

In any case I suspect that you want something involving range() and
random.shuffle() if that helps.


Oscar



More information about the Python-list mailing list