概述
data["mykey"] # returns the associated value
data[12][0] # returns the 13th key in the dictionary
data[12][1] # returns the 13th value in the dictionary
data[12] = ("mykey","myval")
data["mykey"] = "myval"
def SetData(self,cols,data):
for idx,row in enumerate(data):
item = dict((k,v.rstrip() if hasattr(v,'rstrip') else v) for k,v in zip(cols,row))
self.data[idx] = item
self.byid[row[0]] = item
总结
以上是编程之家为你收集整理的python – 以字典形式访问字典全部内容,希望文章能够帮你解决python – 以字典形式访问字典所遇到的程序开发问题。
如果您也喜欢它,动动您的小指点个赞吧