is there an easy way to pull sublists out of a "master list" based upon certain conditions?
Let's say I have a list:
The two lists show two representations of the same thing, i.e. "list2" the elements of
1a = 15, 1b = 15, 1c = 2, 1y= 10. What I'm trying to do is two-fold, first I want to make a list of subsets (derived from list1) which contain 1a in them (the 1a can be in any position). So that would give us the list:
Then I want to take that nlist1 and compare it to list2 to create a new list. The new list is a sublist of nlist1 in which both values given by list2 are equal. That would give the output of:
I tried to tackle this with an
If statement but I was having trouble getting the sublists to print the same way they're shown in the list themselves.