fork download
  1. words = ["a\n", "\n", "ok\n", "\n", ""]
  2.  
  3. print([word.strip() for word in words if word.strip() != ""])
Success #stdin #stdout 0.02s 27696KB
stdin
Standard input is empty
stdout
['a', 'ok']