Re: Random List Loop?!

Discussion in 'Python' started by Roy Smith, Jan 5, 2013.

  1. Roy Smith

    Roy Smith Guest

    In article <>,
    Christian Gabriel <> 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/random.html#random.sample
    Roy Smith, Jan 5, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. globalrev
    Replies:
    4
    Views:
    734
    Gabriel Genellina
    Apr 20, 2008
  2. Roedy Green
    Replies:
    3
    Views:
    406
    Mike Schilling
    Sep 13, 2008
  3. VK
    Replies:
    15
    Views:
    1,090
    Dr J R Stockton
    May 2, 2010
  4. Chris Angelico

    Re: Random List Loop?!

    Chris Angelico, Jan 5, 2013, in forum: Python
    Replies:
    0
    Views:
    129
    Chris Angelico
    Jan 5, 2013
  5. Isaac Won
    Replies:
    9
    Views:
    341
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page