>>> ddict = {}.fromkeys((‘x‘,‘y‘),-1)
>>> ddict
{‘y‘: -1, ‘x‘: -1}
>>> edict = {}.fromkeys((‘foo‘,‘bar‘))
>>> edict
{‘foo‘: None, ‘bar‘: None}
>>>
原文地址:http://blog.51cto.com/yht1990/2144340
时间: 2024-10-12 18:47:26
>>> ddict = {}.fromkeys((‘x‘,‘y‘),-1)
>>> ddict
{‘y‘: -1, ‘x‘: -1}
>>> edict = {}.fromkeys((‘foo‘,‘bar‘))
>>> edict
{‘foo‘: None, ‘bar‘: None}
>>>
原文地址:http://blog.51cto.com/yht1990/2144340