Home
Sign Up
Sign In
ranlan's recent timeline updates
ranlan
V2EX member #451398, joined on 2019-11-06 11:34:18 +08:00
ranlan
提问
技术话题
好玩
工作信息
交易信息
城市相关
ranlan's recent replies
Nov 6, 2019
Replied to a topic by
css3
›
Python
›
两个 list 怎么比较后求出多出来的那值?
不还意思我理解错了
应该是这样
a1 = [x['key'] for x in a]
c = [i for i in b if i['key'] not in a1]
Nov 6, 2019
Replied to a topic by
css3
›
Python
›
两个 list 怎么比较后求出多出来的那值?
b = [{'key': 5, 'value': 6}, {'key': 1, 'value': 2}, {'key': 3, 'value': 41} ]中应该是 {'key': 3, 'value': 41} 这个元素应该是 {'key': 3, 'value': 4}吧?
新手的解法
c = [i for i in b if i not in a]
»
More replies by ranlan
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Solana
·
2851 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms ·
UTC 06:01
·
PVG 14:01
·
LAX 23:01
·
JFK 02:01
♥ Do have faith in what you're doing.
❯