问题:怎么样在两个字典中找相同点
answer:
eg1:
下面2个字典
a={'x':1,'y':2,'z':3}, b={'w':10,'x':11,'y':2},
1)找相同点: a.keys & b.keys()
2)Find keys in a that are not in b: a.keys()-b.keys()
3)过滤字典元素:c={key:a[key] for key in a.keys()-{'z','w'}}
问题:怎么样在两个字典中找相同点
answer:
eg1:
下面2个字典
a={'x':1,'y':2,'z':3}, b={'w':10,'x':11,'y':2},
1)找相同点: a.keys & b.keys()
2)Find keys in a that are not in b: a.keys()-b.keys()
3)过滤字典元素:c={key:a[key] for key in a.keys()-{'z','w'}}
JAVA,c#不同
谈谈React与Vue的不同点和相同点
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M