Answer the question
In order to leave comments, you need to log in
How to compare nested lists in two different lists?
There are two lists:
ina=[[A],[C,A],[E,A],[N,E,A],[M,E,A],[L,C,A],[K, C,A],[D,C,A],[S,L,C,A],[O,N,E,A],[P,M,E,A], [R,M,E, A] ]
inb=[[B],[Y,B],[G,B],[J,Y,B],[U,Y,B],[W,G,B],[X,G ,B],[Z,W,G,B], [R,W,G,B] ]
Each list has many nested lists; each nested list has a letter set. You need to compare nested lists from the list ina with nested lists from the list inb by the first letter (and it doesn't matter which letters come after the first); that is, if both the first and second lists have nested lists starting with the same letter, then both of these nested lists must be output to separate variables. That is, at the end of the program, it should give us these two lists:
oua=[R,W,G,B]
oub=[R,M,E,A]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question