Dictionary update method,dictionarymethod,#The update


#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.

评论关闭