Ordering of dict keys & values

Wells Oliver wells at submute.net
Mon Aug 3 16:47:23 EDT 2009


I understand that the keys in a dictionary are ordered not randomly but
something practically close to it, but if I create a SQL query like so:

query = 'INSERT INTO Batting (%s) VALUES(%s)' % (','.join(stats.keys()),
','.join(stats.values()))

Can I at least rely on the value being in the same index as its
corresponding key?

-- 
Wells Oliver
wells at submute.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090803/8a28386e/attachment.html>


More information about the Python-list mailing list