首页 > python怎么把变量作为字典的key
d = dict(name='a') print d[name]
是不行的
dict的key必须是immutable
d = dict(name='a') print d['name']
加个引号