标签:div 合并 记录 功能 pytho python 2 ict pre python
本博客会不断完善,记录python小功能。
1. 合并两个字典
# in Python 3.5+ >>> x = {‘a‘: 1, ‘b‘: 2} >>> y = {‘b‘: 3, ‘c‘: 4} >>> z = {**x, **y} >>> z {‘c‘: 4, ‘a‘: 1, ‘b‘: 3} # Python 2.x >>> z = dict(x, **y) >>> z {‘a‘: 1, ‘c‘: 4, ‘b‘: 3}
标签:div 合并 记录 功能 pytho python 2 ict pre python
原文地址:https://www.cnblogs.com/carey-he/p/11188738.html