Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
captaincrowbar
· 12y ago · 0 comments
You can do this in one line, without calling strip() twice: stripped_words = [w for w in [w.strip() for w in words] if w]
Comments
[–]
damandumpsta
12y ago
That requires two iterations through the list though, which isn't ideal