相关疑难解决方法(0)

为什么python会像这样订购我的字典?

这是我的字典

propertyList = {
    "id":           "int",
    "name":         "char(40)",

    "team":         "int",
    "realOwner":    "int",

    "x":            "int",
    "y":            "int",

    "description":  "char(255)",

    "port":         "bool",
    "secret":       "bool",
    "dead":         "bool",
    "nomadic":      "bool",

    "population":   "int",
    "slaves":       "int",
}
Run Code Online (Sandbox Code Playgroud)

但是当我用"\n".join(myDict)打印出来时,我得到了这个

name
nomadic
dead
port
realOwner
secret
slaves
team
y
x
population
id
description
Run Code Online (Sandbox Code Playgroud)

我知道字典是无序的,但每次出现都是一样的,我不知道为什么.

python dictionary

41
推荐指数
3
解决办法
4万
查看次数

标签 统计

dictionary ×1

python ×1