Can I call a function inside a Lambda expression in python
问题 I have a function with including if, else condition and for loop. I want to write this function inside a lambda expression. I tried from many ways to create this lambda function. But still I couldn't do it. This is my function with another rules. negation ='no,not,never'.split(',') list2 = 'miss,loss,gone,give up,lost'.split(',') def f(sentence): s = sentence.split() l = [s.index(word) for word in s if word in list2] # Will returns list of indices (of sentence) where word is in list2 if len(l