Map (function, iterable, ...)
Apply function to every item of iterable and return a list of the results. If additional iterable arguments is passed, function must take that many arguments and is applied to the items from all I Terables in parallel. If one iterable is shorter than another it's assumed to be extended withnoneitems. If function IsNone, the identity function is assumed; If there is multiple arguments, map () returns a list consisting of tuples containing the corresponding items from all ITE Rables (a kind of transpose operation). The iterable arguments is a sequence or any iterable object; The result is always a list.
Apply function to every item of iterable and return a list of the results.
Executes each element of an iterable parameter as a function parameter, returning the result as a list.
>>> def foo (a): ... return a**a >>> a[1, 2, 3]>>> Map (foo,a) [1, 4, 27]>>>
If additional iterable arguments is passed, function must take that many arguments and is applied to the items from all I Terables in parallel.
If there are multiple parameters that can be iterated, all iterables will pass elements of the same position at the same time to function (parallel)
>>> def add (b): ... return a+b >>> a=[1,2,3]>>> b=[4,5,6]>>> Map (add,a,b) [5, 7, 9]>>>
I can't translate it:
That's it.
>>> c[7, 8]>>> a[1, 2, 3]>>> map (add,a,c) Traceback (most recent call last): file "<stdin>", line 1, in <module> File "<stdin>", line 2, in addtypeerror: Unsupported operand type (s) for +: ' int ' and ' nonetype ' >>> Map (mm,a,c) traceback (most recent call last): file "<stdin>", line 1, in <module>nameerror: name ' mm ' is not defined>> > map (None,a,c) [(1, 7), (2, 8), (3, none)]>>> a[1, 2, 3]>>> b[4, 5, 6]>>> map (None,a,b) [(1, 4), (2, 5), (3, 6)]>>> c[7, 8]>>> map (none,a,c) [(1, 7), (2, 8), (3, none)]>>>
Python function map