Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I felt the same about number 3.

  [x in tweet.split() for x in wordlist]
Seems better to me than

  map(lambda x: x in tweet.split(),wordlist)
Although the natural thing for me to do would be

  [x for x in wordlist if x in tweet]
Which both generates a list of words instead of booleans(['scala', 'sbt'] instead of [True, False, False, False, False]) and also matches the 'sbt' in tweet.


or just:

    set(tweet.split()) & set(wordlist)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: