Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36192

Re: Random List Loop?!

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <oscar.j.benjamin@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.094
X-Spam-Evidence '*H*': 0.81; '*S*': 0.00; 'elements.': 0.05; 'cc:addr :python-list': 0.10; 'cc:name:python list': 0.16; 'helps.': 0.16; 'wrote:': 0.17; 'cc:2**0': 0.23; 'example': 0.23; 'elements': 0.23; 'random': 0.24; 'tried': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'actual': 0.28; '(perhaps': 0.29; "i'm": 0.29; 'help,': 0.32; 'could': 0.32; 'subject:List': 0.33; 'problem': 0.33; 'anyone': 0.33; 'received:google.com': 0.34; 'christian': 0.34; 'list': 0.35; 'involving': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'but': 0.36; 'does': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'easier': 0.38; 'sure': 0.38; 'instead': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'provide': 0.62; 'different': 0.63; '2013': 0.84; 'gabriel': 0.84; 'oscar': 0.84; 'ages': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZdIJN2p1fsp3mpEJ1MxuTvn5eNYMx3ZXwETARlneusA=; b=ziG2LWtaq08/sqL2i8eJ8LD/fWa0Azhu6XyVJFY3jhaBhkoqZl/JdmoqV2OYaN8G2K GMOwKkZJ2a3STmvAeYHCAZj3JKrPbzYVNZve3tMfRV2tw5rivFKndsEH8xY/eC6x8Gk0 TmTGtBp2npwtisjZ4kUo6lpEIBG+/zH6kepH2dVm/R71E7xiKRL6h2tsb7jK5hIcqrVy 5Mnz0AGCp0yYET6bWH6/M97TeJeC0MIzIEa5lY5ijtWIQBeRhh/WU73y5y2KJumo6gCn agQnKFTDnj+PzmDpI7JGOx44DEw4vDaPHEVQBRokXYAlZkri/owDwbUzb+zVeMhr27kX 6WpA==
MIME-Version 1.0
In-Reply-To <ce887da5-1fad-49af-85e3-96ca41b7148c@googlegroups.com>
References <ce887da5-1fad-49af-85e3-96ca41b7148c@googlegroups.com>
Date Sat, 5 Jan 2013 16:02:18 +0000
Subject Re: Random List Loop?!
From Oscar Benjamin <oscar.j.benjamin@gmail.com>
To Christian Gabriel <gabrieldenmark@gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Cc Python List <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.130.1357401741.2939.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1357401741 news.xs4all.nl 6968 [2001:888:2000:d::a6]:52866
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36192

Show key headers only | View raw


On 5 January 2013 15:47, 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??

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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Random List Loop?! Christian Gabriel <gabrieldenmark@gmail.com> - 2013-01-05 07:47 -0800
  Re: Random List Loop?! Roy Smith <roy@panix.com> - 2013-01-05 10:54 -0500
  Re: Random List Loop?! Chris Angelico <rosuav@gmail.com> - 2013-01-06 02:59 +1100
  Re: Random List Loop?! Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-01-05 16:02 +0000

csiph-web