-2
我要动态地创建动态密钥和值的
在这个字典词典我需要把另一个字典,像这样
例
{"Key Name of file" : "Value Name",
"Specs" : [{"spec1" : "round", "spec2" : "large", "spec3": "pink"}]}
我该如何做到这一点?
下面的代码无法正常工作
save = {}
save['Key name of file'] = 'Value Name'
save['specs'] = []
save['specs'].append([{'spec1', 'spec2', 'spec3'}])
save['specs'][0] = 'round'
save['specs']['spec2'] = 'large'
dictionay有一对关键和价值,你做错了 – Hackaholic 2014-12-13 09:43:43