map - Incompatibility of numpy.sum() with Python 3 -
in python 2.7 1 write:
sum(map(int, "123"))
in python 3 became:
sum(x x in map(int, "123"))
is there way make more concise?
edit:
i running pylab, imports sum()
numpy
changing semantics of first snippet. idle produces same results both python 2.7 , python 3.3 dsm noticed.
note:
i appreciate down voting question leave comment short explanation. edited title (originally: is there way concise notation map() in python 3?) reflect better understanding of underlying issue. else bothers you?
map
still exists in python 3; in fact, first code snippet should still work.
Comments
Post a Comment