我有一个有序字典,想要更改其中的顺序。在下面的代码示例中,我想将第三个项目(people)及其值移动到第二个位置。因此,顺序将变为动物,人,食物,饮料。我该怎么做?
import collections
queue = collections.OrderedDict()
queue["animals"] = ["cat", "dog", "fish"]
queue["food"] = ["cake", "cheese", "bread"]
queue["people"] = ["john", "henry", "mike"]
queue["drinks"] = ["water", "coke", "juice"]
print queue