Dictionary order?

2QdxY4RzWzUUiLuE at potatochowder.com 2QdxY4RzWzUUiLuE at potatochowder.com
Mon Aug 1 17:46:54 EDT 2022


On 2022-08-01 at 13:41:11 -0700,
Dan Stromberg <drsalists at gmail.com> wrote:

> keys = [5, 10, 15, 14, 9, 4, 1, 2, 8, 6, 7, 12, 11]
> 
> dict_ = {}
> for key in keys:
>     dict_[key] = 1

$ python
Python 3.10.5 (main, Jun  6 2022, 18:49:26) [GCC 12.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> [hash(x) for x in range(20)]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]

Just sayin'.  :-)


More information about the Python-list mailing list