十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
>>> dict1 = {'name': 'earth', 'port': 80}
>>> for key in dict1:
... print 'key=%s,value=%s' % (key,dict1[key])
...
key=name,value=earth
key=port,value=80
>>> dict1['name']
'earth'
>>> print 'host %s is running on port %d' % (dict1['name'],dict1['port'])
host earth is running on port 80
>>>