Re: set & random.choice question

2005-12-14 Thread cgriddell
Oh duh. :) Thanks for pointing out the obvious without mocking... sc -- http://mail.python.org/mailman/listinfo/python-list

Re: set & random.choice question

2005-12-14 Thread Dennis Benzinger
[EMAIL PROTECTED] schrieb: > I want to do something like this: > > from random import choice > x = set(("jenny", "jacqui", "claire", "chris", "tracy")) > somebody = random.choice(x) > > but I bet a "TypeError: unindexable object" error. Any suggestions for > an elegant workaround? > > I'm

Re: set & random.choice question

2005-12-14 Thread Christophe Delord
Hello, On 14 Dec 2005 12:16:22 -0800, [EMAIL PROTECTED] wrote: > I want to do something like this: > > from random import choice > x = set(("jenny", "jacqui", "claire", "chris", "tracy")) > somebody = random.choice(x) > > but I bet a "TypeError: unindexable object" error. Any suggestions

Re: set & random.choice question

2005-12-14 Thread Lawrence Oluyede
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")) s

set & random.choice question

2005-12-14 Thread stevecanfield
I want to do something like this: from random import choice x = set(("jenny", "jacqui", "claire", "chris", "tracy")) somebody = random.choice(x) but I bet a "TypeError: unindexable object" error. Any suggestions for an elegant workaround? I'm using set because I want to know that I have a