3 ms·
More traditional Python: >>> import operator >>> a, b = [1, 2, 3], [4, 5, 6] >>> map(operator.add, a, b) [5, 7, 9] List comprehensions are a relativel
by zurn 11y ago
More traditional Python:
>>> import operator
>>> a, b = [1, 2, 3], [4, 5, 6]
>>> map(operator.add, a, b)
[5, 7, 9]
List comprehensions are a relatively late addition to the language and don't really warrant being called "more Pythonic" in this case IMO.
(Yet more traditional Python would be the plain for loop, of course)