I have a sorted list and a range contains multiple lists:
>>> n= [10, 20, 30, 40]
>>> m= [[1, 20], [21, 30]]
What I am trying to do is to check if all the elements of the n
list are within either of the existing ranges in m
or not. For instance, from the above example, 40 is not within any of the ranges.
I tried to extend the answer to the question in the following post, but seems it is not working.
Checking if all elements of a List of Lists are in another List of Lists Python
is_there = set(tuple(x) for x in [n]).issubset(tuple(x) for x in m)