可以说我有以下代码:
import collections d = collections.OrderedDict() d['foo'] = 'python' d['bar'] = 'spam'
有没有办法以编号的方式访问这些项目,例如:
d(0) #foo's Output d(1) #bar's Output
python collections dictionary ordereddictionary python-3.x
collections ×1
dictionary ×1
ordereddictionary ×1
python ×1
python-3.x ×1