Skip to content

Instantly share code, notes, and snippets.

@the5fire
Created July 27, 2015 03:45
Show Gist options
  • Save the5fire/fcf3ec9c7b708541a224 to your computer and use it in GitHub Desktop.
Save the5fire/fcf3ec9c7b708541a224 to your computer and use it in GitHub Desktop.
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