[EMAIL PROTECTED] wrote:
From the Python 2.4 quickreference:

d.popitem() Removes and returns an arbitrary (key, value) pair from d

If this isn't random enough, then you can generate a random number in
range(len(d))

Although this idea may suit the OP, "arbitrary" is most definitely not "random". Given the same dictionary on two separate occasions, this approach results in precisely the same sequence of items being returned.

-Peter
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to