Il 2005-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto:
> I want to do something like this:
>
>   from random import choice
>   x = set(("jenny", "jacqui", "claire", "chris", "tracy"))
>   somebody = random.choice(x)

import random
x = set(("jenny", "jacqui", "claire", "chris", "tracy"))
somebody = random.choice(list(x))

You must turn back it into a list, set has no notion of indexing

-- 
Lawrence - http://www.oluyede.org/blog
"Anyone can freely use whatever he wants but the light at the end
of the tunnel for most of his problems is Python"
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to