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

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -