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: 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: References: Date: Sat, 5 Jan 2013 16:02:18 +0000 Subject: Re: Random List Loop?! From: Oscar Benjamin To: Christian Gabriel Content-Type: text/plain; charset=ISO-8859-1 Cc: Python List X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On 5 January 2013 15:47, 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?? 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