"Norman Khine" <[EMAIL PROTECTED]> wrote 

> q_keys.sort()
> a = [q[x] for x in q_keys]

a = [random.choice(q[x]) for x in q_keys]

> 
> So from this how do I choose a random element and produce a new 
> dictionary like for example:

See above.


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to