built-in class
map/built-in type map
About built-in classes
Map is a built-in class that can return a map of obj. The first parameter of map is an executable function, and subsequent parameters are iterated objects, and map iterates over subsequent parameters and passes them to the executable function, saving the result.
1 def Foo (A, B, c): 2 return a+b+C3print(list (map (foo, range (4), Range (4), Range (4)))
The above code outputs the result as
[0, 3, 6, 9]
Note: in Python2, because map is still a function, the result returned is not obj but a list, which can be printed directly, and the map function supports None as the first parameter, and returns a result similar to the zip effect. However, this feature has been canceled in Python3.
For a map of Python2, refer to here.
Related reading
1. About the built-in class
Python's program structure [2], class/class, built-in class map