Well, let's say I have a list, and I want to check if this list exists in another list. I can do it:
all(value in some_map for value in required_values)
This works fine, but lets say that I want to raise an exception when the required value is missing, with a value that it is missing. How can I do this using list comprehension?
I'm more or less curious, all the signs seem to indicate an absence.
EDIT Argh I meant this:
for value in required_values:
if value not in some_map:
raise somecustomException(value)
Looking at those that I can’t understand, how can I find the value in which the error occurred
source
share