3 ms·
operator.add doesn't scale to n lists. Would be weird in this case as well. You'd need: map(lambda x: operator.add(*x), zip(x, y)) map might not be `pythonic`
by bpicolo 11y ago
operator.add doesn't scale to n lists. Would be weird in this case as well. You'd need:
map(lambda x: operator.add(*x), zip(x, y))
map might not be `pythonic` but I typically pull out map/reduce/filter for the trivial cases. filter(bool, list_)
is just as understandable as [i for i in list_ if i]