我有一本有序的字典,想更改个别的顺序。在下面的代码示例中,我希望项目 3(人)及其值移动到位置 2。因此顺序将是动物、人、食物、饮料。我该怎么处理他的?
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