I have a lambda function which returns a list of options selected by the user against a question in the front-end. It looks like:
selected_options = lambda x: get_options(x, question.id),
returning a list like [5, 6]. I want to check if any members of the returned list are in another list, say, [2,5,7,11]. Python wouldn't allow iterating on lambda expressions. Using if selected_options in [2,5,7,11] will check for whole returned list, not the individual members, so will work when user selects one options only.
If you can find a duplicate question, please point me to it. I couldn't.