select random entry from dictionary

gaudetteje at gmail.com gaudetteje at gmail.com
Mon Mar 7 20:42:22 EST 2005


>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))




More information about the Python-list mailing list