Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: Random List Loop?! (http://www.velocityreviews.com/forums/t956168-re-random-list-loop.html)

Roy Smith 01-05-2013 03:54 PM

Re: Random List Loop?!
 
In article <ce887da5-1fad-49af-85e3-96ca41b7148c@googlegroups.com>,
Christian Gabriel <gabrieldenmark@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??
>
> Best
>
> Christian


You want random.sample()

http://docs.python.org/2/library/ran...#random.sample


All times are GMT. The time now is 06:28 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57