返回顶部

收藏

Dictionary update method

更多
#The update method updates one dictionary with the items of another:

d = {   'title': 'Python Web Site',
        'url': 'http://www.python.org',
        'changed': '3. august 2001 21:08:05 GMT'
    }
x = {'title': 'Python Language Website'}
d.update(x)
print d

#The items in the supplied dictionary are added to the old one, overwriting any items 
#there with the same keys.

标签:Python,Dictionary

收藏

0人收藏

支持

0

反对

0