Created
July 27, 2015 03:45
-
-
Save the5fire/fcf3ec9c7b708541a224 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d1 = { | |
"a1": 1, | |
"a2": 2, | |
"a3": 3, | |
"a4": 4, | |
"a5": 5, | |
} | |
d2 = { | |
"a4": 90, | |
"a6": 5, | |
"a1": 2, | |
"a9": 8, | |
"a8": 9, | |
} | |
# 1. 获取d1和d2key的交集,并以d2的值为主生成dict | |
# 2. 去掉d1和d2中key重复以及value重复的值,合并成一个dict |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment