← Lesson
Features
Joeven
Run
Reset
Python loads on first run
WORDS = ["down", "refund", "please"] def features(text): t = text.lower() return [1 if w in t.split() else 0 for w in WORDS] rows = [ "the site is down", "please refund my order", "hello there", "down please refund", ] print("words", WORDS) for text in rows: print(features(text), text)
Run to execute this in your browser. Nothing is sent to a server.