- ✕This summary was generated using AI based on multiple online sources. To view the original source information, use the "Learn more" links.
The map() function in Python is a built-in function that allows you to apply a specified function to each item in an iterable (such as a list, tuple, etc.) and return a map object (which is an iterator) of the results. This function is particularly useful for transforming data efficiently and concisely.
Syntax and Usage
The syntax for the map() function is:
map(function, iterable, ...)Copied!✕Copyfunction: The function to execute for each item.
iterable: A sequence, collection, or an iterator object. You can pass multiple iterables, but the function must have one parameter for each iterable.
Examples
Basic Example
Here is a basic example of using map() to double the numbers in a list:
def addition(n):return n + nnumbers = (1, 2, 3, 4)result = map(addition, numbers)print(list(result))Copied!✕CopyOutput:
[2, 4, 6, 8]Copied!✕CopyIn this example, the addition function is applied to each element in the numbers tuple, doubling each number.
Using Lambda Expressions
Python map () Function - W3Schools.com
Learn how to use the map() function to execute a specified function for each item in an iterable. See examples of how to calculate the length of words, make new fruits, and more.
See results only from w3schools.comPython Intro
Python Syntax compared to other programming languages Python was …
HTML
HTML - Python map () Function - W3Schools.com
CSS
CSS - Python map () Function - W3Schools.com
W3Schools Pathfinder
W3Schools Pathfinder helps users navigate through web development and …
❮ Built-in Functions
❮ Built-in Functions - Python map () Function - W3Schools.com
Quiz
Quiz - Python map () Function - W3Schools.com
Python map () function - GeeksforGeeks
Mar 18, 2026 · map () function in Python applies a given function to each element of an iterable (list, tuple, set, etc.) and returns a map object (iterator). It is a higher-order function used for uniform …
Python's map (): Processing Iterables Without a Loop
Learn how to use map() to apply a function to each item in an iterable and produce a new iterable. See examples of mapping strings, numbers, and other data types with …
How To Use The Map () Function In Python?
Jan 6, 2025 · Learn how to use the map () function in Python to apply a function to all items in an iterable. See examples of converting temperatures, capitalizing names, calculating square roots, and …
Python map() Function: A Complete Guide - DataCamp
Dec 10, 2025 · In this tutorial, I’ll show you the syntax, practical applications, and advanced techniques of Python’s map() function. We’ll also look at lazy evaluation …
Python map () – List Function with Examples - freeCodeCamp.org
Nov 9, 2021 · Learn how to use the map() function in Python to apply a function to each item in an iterable and return a new iterable. See how to use lambda expressions, built-in functions, and multiple …
Python map () Method - AskPython
Jan 24, 2026 · When you call map (), Python doesn’t immediately process your data. Instead, it returns a map object that computes values only when you request them. …
Python map () Function: Syntax, Usage, Examples
Apr 17, 2025 · Learn how to use the map() function in Python to transform data with custom functions, lambda expressions, or built-in functions. See how to apply …
Python map () Function (With Examples) - TutorialsTeacher.com
In the following example, a built-in function pow () is given to map two list objects, one for each base and index parameter. The result is a list containing the power of each number in bases raised to the …
Built-in Functions — Python 3.14.3 documentation
1 day ago · Built-in Functions ¶ The Python interpreter has a number of functions and types built into it that are always available. They are listed here in alphabetical order.
- People also ask