返回顶部

收藏

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

»更多 您可能感兴趣的代码
  1. 2013-06-05 13:21:25python 使用MySQLdb连接mysql by 玉开Sir
  2. 2015-11-30 12:00:58Change dictionary entry by 司马
  3. 2016-08-18 16:06:03Dictionary get value by 张宋付
  4. 2016-01-18 18:59:48Reference dictionary in print function by 大猪
  5. 2016-08-18 16:22:21Dictionary: items and iteritems by Solon.Ring
  6. 2016-08-19 10:11:08Copy a dictionary by 司马
  7. 2016-09-15 14:35:42Dictionary: values and itervalues by 山药
  8. 2016-01-10 09:34:59If it has a certain key by 张宋付
  9. 2016-02-05 11:12:31Dictionary popitem by xwz
  10. 2016-08-18 16:39:08Dictionary: The keys, values, and items Functions by xwz
  11. 2016-08-31 12:28:03Dictionary has_key method by 山药

发表评论