Home » Programming
Using the Python ‘map()’ Function to Process a List, With Examples
This article will explain the map() function in Python and show you how to use it. The Python map() function applies a given function for all items in an iterable (iterables are things like lists, dictionaries, sets, or tuples – collections containing items that can be looped over). The syntax and code in this article will work for both Python 2 and Python 3. Syntax for Python map() The map() function is built into Python, so nothing needs to be imported. Here’s the syntax: map(FUNCTION, ITERABLE) Note that: FUNCTION is a standard … Read more