在Python中列出比较 [英] List comparision in Python
本文介绍了在Python中列出比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好b $ b
我有2个列表。我想比较并得到差异。
Hi
I have 2 list .I want to compare and get the difference.
a = [['vlan 158', ' name MARKET', ' mode vpc'], []]
b = [['vlan 158', ' name MARKETING', ' mode vpc'], ['vlan 159', ' name SALES', ' mode vpc']]
预期产量:
缺少a
Expected Output :
Missing in "a"
vlan 159
name SALES
mode vpc
请建议怎么做?
注意:列表a有Vlan 158所以列表b 。这是一个比赛,虽然名字是不同的。不担心...
我尝试过: < br $>
尝试了很多东西但没有得到预期的结果
please suggest how can it be done?
Note : list "a" has Vlan 158 so as list "b" .So its a MATCH ,though "name" is different.not worried about that...
What I have tried:
Tried Many stuff but not getting the expected result
推荐答案
参见5。数据结构 - Python 3.4.9文档 [ ^ ]
这篇关于在Python中列出比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文