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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -