F
F
FenixFVE2018-02-23 14:55:38
Python
FenixFVE, 2018-02-23 14:55:38

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]
5a9000fe5fdca683532345.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question