Random List Loop?!

Chris Angelico rosuav at gmail.com
Sat Jan 5 10:59:16 EST 2013


On Sun, Jan 6, 2013 at 2:47 AM, 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??

Sounds like a homework question to me.

You've tried. What code have you come up with, and to what extent does
it fall short of your goal?

The nine different lists - do they have unique elements?

Are you able to use sets? (If you haven't been taught what a set is,
the answer's probably no.)

ChrisA



More information about the Python-list mailing list