If you want to convert each of the lists to a list of integers, you can do

a, b = ['1','2','3'], ['1','2']
print(list(map(lambda x: map(int,x), [a, b])))
# [[1, 2, 3], [1, 2]]

which can be assigned to a and b back, like this

a, b = map(lambda x: map(int,x), [a, b])

If you want to chain the elements, you can use itertools.chain, like this

from itertools import chain
print(list(map(int, chain(a,b))))
# [1, 2, 3, 1, 2]

Edit: if you want to pass more than iterable as arguments, then the function also has to accept that many number of parameters. For example,

a, b = [1, 2, 3], [1, 2, 3]
print(list(map(lambda x, y: x + y, a, b)))
# [2, 4, 6]

If we are passing three iterables, the function has to accept three parameters,

a, b, c = [1, 2, 3], [1, 2, 3], [1, 2, 3]
print(list(map(lambda x, y, z: x + y + z, a, b, c)))
# [3, 6, 9]

If the iterables are not of the same size, then the length of the least sized iterable will be taken in to consideration. So

a, b, c = [1, 2, 3], [1, 2, 3], [1, 2]
print(list(map(lambda x, y, z: x + y + z, a, b, c)))
# [3, 6]
Answer from thefourtheye on Stack Overflow
🌐
Real Python
realpython.com › python-map-function
Python's map(): Processing Iterables Without a Loop – Real Python
March 18, 2026 - According to the documentation, ... (or multiple iterables) as arguments and returns an iterator that yields transformed items on demand. The function’s signature is defined as follows: ... map() applies function to each item in iterable in a loop and returns a new iterator that yields transformed items on demand. function can be any Python function that ...
People also ask

What does map() do in Python?
map() applies a callable to items from one or more iterables and returns a lazy iterator of the results.
🌐
pythonpool.com
pythonpool.com › home › programs › python map(): lazy iterators, multiple inputs, and strict
Python map(): Lazy Iterators, Multiple Inputs, and strict
Is map() lazy in Python?
Yes. A map object produces values when it is consumed, so converting it to a list materializes the results.
🌐
pythonpool.com
pythonpool.com › home › programs › python map(): lazy iterators, multiple inputs, and strict
Python map(): Lazy Iterators, Multiple Inputs, and strict
What happens when map() receives different iterable lengths?
Mapping normally stops when the shortest iterable is exhausted; newer Python versions can use strict=True to raise on a length mismatch.
🌐
pythonpool.com
pythonpool.com › home › programs › python map(): lazy iterators, multiple inputs, and strict
Python map(): Lazy Iterators, Multiple Inputs, and strict
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › python map() with multiple arguments
Python map() with Multiple Arguments - Spark By {Examples}
May 31, 2024 - How to pass multiple iterable as arguments to a python map? You can use python map() with multiple iterable arguments by creating a function with multiple
🌐
ZetCode
zetcode.com › python › python-map
Python map - presenting Python map function
January 29, 2024 - #!/usr/bin/python nums = [1, 2, 3, 4, 5] nums_squared = map(lambda x: x*x, nums) for num in nums_squared: print(num) The code example squares the elements of a list with map and anonymous function created with lambda. We have mentioned earlier that we can pass multiple iterables into map.
Top answer
1 of 2
5

Map with multiple iterators:

Given your desired intermediate output I'd say that map isn't the right tool to get a j containing the integers 1-9.

That's because map with multiple iterators goes through the iterators simultaneously:

It doesn't repeat, that's just because it's a gif file.

The problem(s) in your approaches:

In the first iteration it will return "1", "4", "7" (the first elements of each iterable) the next iteration will return "2", "5", "8" and the last iteration "3", "6", "9".

On each of these returns it will apply the function, in your first example in the first iteration that's

int("1") and int("4") and int("7")

which evaluates to 7 because that's the last truthy value of the chained ands:

>>> int("1") and int("4") and int("7")
7

That also explains why the result is 24 because the results of the other iterations are 8 and 9:

>>> int("2") and int("5") and int("8")
8
>>> int("3") and int("6") and int("9")
9

>>> 7 + 8 + 9
24

In your second example you added the strings (which concatenates the strings) and then converted it to an integer:

>>> "1" + "4" + "7"
"147"
>>> int("147")
147

The solution:

So, you need the addition from your second approach but apply the int to each variable like you did in the first example:

j = list(map(lambda x, y, z: int(x)+int(y)+int(z), num, num2, num3))

A better solution:

But for that problem I would probably use a different approach, especially if you want the "desired" j.

To get that you need to chain the iterables:

import itertools
chained = itertools.chain(num, num2, num3)

Then convert all of them to integers:

chained_integers = map(int, chained)

This chained_integers is the iterator-equivalent to the [1, 2, 3, 4, 5, 6, 7, 8, 9] list you wanted as j. You could also use chained_integers = list(map(int, chained)) and print the chained_integers before proceeding if you want to double-check that.

And finally to reduce it I would actually use the built-in sum function:

reduced = sum(chained_integers)  # or "reduce(lambda x, y: x+y, chained_integers)"

Or the one-line-version:

sum(map(int, itertools.chain(num, num2, num3)))

An alternative solution using a comprehension instead of map:

Even simpler would be a comprehension (in this case I used a generator expression) instead of the map:

reduced = sum(int(v) for v in itertools.chain(num, num2, num3))

An alternative solution using a generator function:

That's pretty short and easy to understand but I would like to present another example of how to do it using your own generator function:

def chain_as_ints(*iterables):
    for iterable in iterables:
        for item in iterable:
            yield int(item)

And you could use it like this:

sum(chain_as_ints(num, num2, num3))

In this case a generator function is not really necessary (and probably not advisable given the alternatives) I just wanted to mention it for completeness.

2 of 2
0

Since you want to iterate over the elements of each list as one long list, it is easiest to just concatenate them:

nums = map(int, num + num2 + num3)
🌐
Reddit
reddit.com › r/learnpython › is there a better functional way to map an iterable of iterables?
r/learnpython on Reddit: Is there a better functional way to map an iterable of iterables?
March 26, 2021 -
ranges = [range(2), range(4), range(1)]
# I want to map a function onto the inner iterables. In this case, str.
list_comps = [[str(n) for n in r] for r in ranges]
gen_exps = ((str(n) for n in r) for r in ranges)
maps = map(lambda r: map(str, r), ranges)  # Is there a better way?
expected = [['0', '1'], ['0', '1', '2', '3'], ['0']]
# Test
for mapped in [list_comps, gen_exps, maps]:
    actual = list(map(list, mapped))
    assert expected == actual, actual

Edit: I'm going for a generator of generators. I'd rather not precompute into a list/tuple for memory and shortcutting.

Edit2: Summary for people of the future.(map(str, r) for r in ranges) is my new favorite. It's from this comment by u/MKuranowski. There's also map(map, repeat(str), ranges).

I realized this is just a specific case of a more general problem: that I love map for functions with one argument and dislike map for functions with more than one argument.

numbers = ['1', '2', '3']
sum(map(int, numbers))  # I like that a lot
sum(int(n) for n in numbers)) # I like that less.

On the generator expression, it's the n that bothers me. It feels like that variable isn't really do anything. Things change when the function needs more than one variable.

bins = ['0', '1', '101]  
sum(map(lambda n: int(n, base=2), bins)) # meh  
sum(int(n, base=2) for n in bins)) # better  

Now that n has meaning. It's showing that it's the first argument to int. Multiple iterables for arguments is interesting.

bases = [2, 3, 4]  
exponents = [0, 1, 2]  
sum(map(pow, bases, exponents))  
sum(pow(a, b) for a, b in zip(bases, exponents))  

If they're already in tuples, then I think itertools.starmap wins.

zipped = list(zip(bases, exponents))  
sum(starmap(pow, zipped))  
sum(pow(*x) for x in zipped)

You can treat a repeated argument like an iterable with itertools.repeat. This reminds me of writing Clojure.

bins = ['0', '1', '101]  
sum(map(int, bins, repeat(2))

Now back to the original idea. map is a function with multiple arguments. So it's not the best candidate as a function to pass to map. Instead, we end up mixing genexps and maps. I don't have a tiny example in mind for what to use this generator of generators for, so it won't be passed to anything else like in the examples above.

ranges = [range(2), range(4), range(1)]
(map(str, r) for r in ranges)

But after writing all this out, I may just go full functional.

map(map, repeat(str), ranges)

And as a random side-note, I just realized you can use itertools.cycle and map to change arguments based on the modulo of the index.

from operator import add
map(add, 'XYZ', cycle('AB')) # -> ('XA', 'YB', 'ZA')

Find elsewhere
🌐
Devcuriosity
devcuriosity.com › manual › details › python-map-function
Python - map() function with examples
Lazy Evaluation: map() returns a lazy iterator, meaning elements are only computed as needed. Multiple Iterables: You can pass multiple iterables to map(), but it will stop processing once the shortest iterable is exhausted.
🌐
GeeksforGeeks
geeksforgeeks.org › python-map-function
Python map() function - GeeksforGeeks
We can use map() with multiple iterables if the function we are applying takes more than one argument. Example: In this example, map() takes two iterables (a and b) and applies the lambda function to add corresponding elements from both lists.
Published: October 23, 2024
🌐
Python Pool
pythonpool.com › home › programs › python map(): lazy iterators, multiple inputs, and strict
Python map(): Lazy Iterators, Multiple Inputs, and strict
July 14, 2026 - A short map() call with a named function is clear; a dense lambda with side effects usually is not. Check lazy consumption, callable signatures, exceptions, input lengths, and materialization. With multiple iterables, the callable receives one item from each iterable in parallel. Regular behavior stops when the shortest iterable is exhausted. On Python versions that support it, strict=True raises ValueError when lengths do not match, exposing alignment bugs early.
🌐
Tutorial Reference
tutorialreference.com › python › examples › faq › python-how-to-use-map-function-with-multiple-arguments
How to Pass Multiple Arguments to map() in Python | Tutorial Reference
March 28, 2025 - map() will then "zip" the iterables together, passing corresponding elements from each iterable as arguments to your function. ... map(multiply, list_1, list_2): This calls the multiply function with corresponding elements from list_1 and list_2:
🌐
LearnDataSci
learndatasci.com › solutions › python-map
Python map(function, iterable, ...) – LearnDataSci
Given a function and multiple iterables as parameters, map() matches the nth iterable to the function's nth parameter. Here weights are given to x and heights are given to y. In the BMI example, we used map() with multiple iterables of equal length.
🌐
GeeksforGeeks
geeksforgeeks.org › python-pass-multiple-arguments-to-map-function
Python - pass multiple arguments to map function - GeeksforGeeks
September 13, 2022 - Passing Multiply function, list1, list2 and list3 to map(). The element at index 0 from all three lists will pass on as argument to Multiply function and their product will be returned.
🌐
Kanaries
docs.kanaries.net › topics › Python › python-map-function
Python map() Function: Transform Iterables with Examples – Kanaries
February 10, 2026 - It takes a function and one or more iterables, applies the function to every element, and returns an iterator of results. One line replaces five. The code reads like a description of what you want, not how to do it. ... This guide covers every practical aspect of the Python map function: the basic syntax, combining map with lambda and built-in functions, working with multiple iterables, performance comparisons against list comprehensions, and real-world data processing patterns you will use in production code.
🌐
All About AI-ML
indhumathychelliah.com › 2020 › 09 › 14 › exploring-map-vs-starmap-in-python
Exploring Map() vs. Starmap() in Python – All About AI-ML
January 2, 2022 - If additional iterable arguments are passed, the function must take that many arguments and is applied to the items from all iterables in parallel. With multiple iterables, the iterator stops when the shortest iterable is exhausted.” — Python’s documentation · The map() function is used to apply a function to each item in the iterable.
🌐
Stack Abuse
stackabuse.com › bytes › pass-multiple-arguments-to-the-map-function-in-python
How to Pass Multiple Arguments to the map() Function in Python
September 21, 2023 - def multiply(x, y): return x * y numbers1 = [1, 2, 3, 4, 5] numbers2 = [6, 7, 8, 9, 10] result = map(multiply, numbers1, numbers2) print(list(result)) # Output: [6, 14, 24, 36, 50] Note: Make sure that the number of arguments in the function should match the number of iterables passed to map()! ...
🌐
Real Python
realpython.com › lessons › mapping-values-iterables
Mapping Values and Iterables (Video) – Real Python
Since I’m using multiple iterables in map(), each invocation of the lambda will use the corresponding index value from the set of iterables. 04:50 So the first invocation sums 1 and 10 from the first position of each of the iterables. The second will sum 2 and 20, etc, giving the end result of 11, 22, and 33. 05:04 All of the operations that you do in Python...
Published: December 9, 2025
🌐
DataCamp
datacamp.com › tutorial › python-map-function
Python map() Function: A Complete Guide | DataCamp
December 10, 2025 - When you provide multiple iterables, ... the number of iterables. For example, to calculate the total value of different products in an inventory, you might have three separate lists....
🌐
Miguendes
miguendes.me › how-to-pass-multiple-arguments-to-a-map-function-in-python
Python: Using the map() Function With Multiple Arguments (2021)
October 11, 2021 - For each item in these iterables, map applies the function passed as argument. The result is an iterator where each element is produced by the function you provided as argument. If you pass multiple iterables, you must pass a function that accepts that many arguments.
🌐
IONOS
ionos.com › digital guide › websites › web development › python map
How to use Python map() - IONOS
July 18, 2023 - The first parameter describes the function that is to be used on every element of the iterable , and the second parameter is the iterable that you want to iterate. The function will return a Python map object with the function you passed applied to it. To work with the data, you can give the return value to functions such as Python list () or set(). To better un­der­stand how Python map works, let’s take a look at an example.
🌐
Medium
medium.com › @arnabdas95 › python-map-function-for-iterables-65efa54bf3ca
Python map() function for iterables | by Arnab Das | Medium
November 2, 2021 - #one iterable is passed map(function ,iterable) #more than one iterables are passed map(function,iterable_1,iterable_2,...,iterable_n)