AI engineering glossary · Python core

What is map?

map: A built-in function that applies a given function to every item of an iterable and returns a lazy iterator of the results. It is an alternative to a list comprehension.

Level: intermediateTopic: Python core

map: an example

list(map(len, ['a', 'bb', 'ccc'])) gives [1, 2, 3].

Related terms

More Python core terms

Where you learn it

map is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.