(Aug-05-2018, 02:16 PM)Nirmal Wrote: So the first element of "list a" ( e:g vlan 158" in this case ) has to be checked in "list b" and vice versa and if it is found then fine. If it is not found ( e:g vlan 159 ) is not available in "list a" then it should return everything i.e "list a " has below
When you say: "has to be checked in "list b"" are you meaning the first element of "list a" needs to be checked against the first element of each list in "list b"? S/T each matching instance can be ignored but none matching instances will result in a 'print' of the remaining elements in that list? For instance the program would for:
a = [['vlan 158', ' name MARKET', ' mode vpc'], []] b = [['vlan 158', ' name MARKETING', ' mode vpc'], ['vlan 159', ' name SALES', ' mode vpc']]produce the output:
#first element of list a matches first element of list b thus ignore name SALES, mode vpc #first element of list a does not match second element of list b thus print name MARKETING, mode vpc #second element in list a is an empty list thus will not match first element in list b thus print name SALES, mode vpc #second element in list a is an empty list thus will not match second element in list b thus print