我想做下面的事情。我希望在列表理解中輸出條件表達式。列表理解有可能嗎?python list_comprehension得到多個值
def why_bad(myvalue): #returns a list of reasons or an empty list it is good
...
return [ reason1, reason2 ..]
bad_values = [ (myvalue,reasons) for myvalue in all_values if (reasons = why_bad(myvalue)) ]