Discuss / Python / 一个小困惑

一个小困惑

Topic source

nishno_s45

#1 Created at ... [Delete] [Delete and Lock User]

dict类型打印key,每次都是随机打印的。想了解一下,dict在计算机里存储和打印具体是什么情况。然后随机计算机是怎么操作的。

d = {'a': 1, 'b': 2, 'c': 3}
>>> for key in d:
...     print(key)

lmtooT_T

#2 Created at ... [Delete] [Delete and Lock User]

建议你了解一下hashcode和equals


  • 1

Reply