title: Python:Syntax Error while using Lambda Function inside List
body: <p>I am relatively new to python. I am trying to filter data in List using a Lambda, but the compiler gives me a syntax error for the commented code.</p>
  
  <pre><code># documents = [(list(filter(lambda w:w if not  w in stop_words,movie_reviews.words(fileid))),category)
  #         for category in movie_reviews.categories()
  #         for fileid in movie_reviews.fileids(category)]
  #
  documents = [(list(movie_reviews.words(fileid)),category)
          for category in movie_reviews.categories()
          for fileid in movie_reviews.fileids(category)]
  </code></pre>
  
  <p>The uncommented section works, but the commented section gives a syntax error. Any inputs what i am doing wrong here?</p>