dictionary method question

Sean 'Shaleh' Perry shalehperry at attbi.com
Tue Apr 23 15:42:02 EDT 2002


On 23-Apr-2002 dsavitsk wrote:
> for some dictionary d is there any relationship between the returns from
> d.keys() and d.values()?  that is, to get them in some arbitrary but
> matching order, do i need to loop over d.items() or can i count on a
> similarity of the above? in small tests this seems to be the case.
> 

I would only trust d.items() but it makes sense that keys and values should be
in the same order.





More information about the Python-list mailing list