I am new to python. I have a few questions coming from an armature!

Marko Rauhamaa marko at pacujo.net
Tue Aug 16 04:17:57 EDT 2016


Chris Angelico <rosuav at gmail.com>:

> most of the point of map() is to make use of an existing function:
>
> # Instead of
> lengths = (len(x) for x in items)
> # Use
> lengths = map(len, items)

Both methods are available and I have used each of them, but the former
is probably always preferable.


Marko



More information about the Python-list mailing list