Ai
2 Star 1 Fork 1

望曦开源团队/Python案例合集

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
MergaDict.py 281 Bytes
一键复制 编辑 原始数据 按行查看 历史
NineSenz-九练 提交于 2023-05-02 00:00 +08:00 . 合并两个字典
# 给定两个字典,然后将它们合并为一个字典
def Merge(dict1, dict2):
return(dict2.update(dict1))
# 两个字典
dict1 = {'a': 10, 'b': 8}
dict2 = {'d': 6, 'c': 4}
# 返回 None
print(Merge(dict1, dict2))
# dict2 合并了 dict1
print(dict2)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/wangxios/workspace_Python.git
git@gitee.com:wangxios/workspace_Python.git
wangxios
workspace_Python
Python案例合集
master

搜索帮助