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, map() takes a function object and an iterable (or multiple iterables) as arguments and returns an iterator that yields transformed items on demand.
Discussions

multiple iterators for map() function in python? - Stack Overflow
I know there's a way to have the python map function execute for multiple iterators in one command, but I keep getting syntax or valueErrors, or if it does compile it just overwrites previous itera... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Python's filter(): Extract Values From Iterables โ€“ Real Python
Use iterable comprehension instead [v for v in values if v==42] More on reddit.com
๐ŸŒ r/Python
39
342
June 9, 2021
Is there a better functional way to map an iterable of iterables?
I think you're trying too hard to mix iterators with lists. To map a function to every element of every sub-iterator in an iterator I would do this: (map(func, i) for i in iterator_of_iterators) But this gives a generator of generators. This makes is awkward when unpacking into a list of lists, so I would probably change the usage: ranges = [range(2), range(4), range(1)] # or whatever, as long as it's Iterable[Iterable[Any]] expected = [["0", "1",], ["0", "1", "2", "3"], ["0"]] mapped_ranges = (map(str, i) for i in ranges) for inner_mapped_range, inner_expected in zip(mapped_ranges, expected): assert list(inner_mapped_range) == inner_expected More on reddit.com
๐ŸŒ r/learnpython
12
2
March 26, 2021
Iterable... but how many times?
Like you said. iterable - implements __iter__, which gives an iterator. iterator - implements __next__, which gives the next element. So, an iterator is just something that takes you to the next object. To your question, I think the docs give a good reason why an iterator also has to implement __iter__, additionally to __next__: Iterators are required to have an __iter__() method that returns the iterator object itself so every iterator is also iterable and may be used in most places where other iterables are accepted. One notable exception is code which attempts multiple iteration passes. More on reddit.com
๐ŸŒ r/Python
110
113
February 1, 2024
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
๐ŸŒ
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')

๐ŸŒ
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)
Find elsewhere
๐ŸŒ
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.
๐ŸŒ
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 - Use Python map() as a lazy iterator, convert results, align multiple iterables, handle strict length checks, and compare comprehensions.
๐ŸŒ
Devcuriosity
devcuriosity.com โ€บ manual โ€บ details โ€บ python-map-function
Python - map() - Apply a function to all elements in an iterable
map(function, iterable) applies a given function to each item of an iterable (or multiple iterables) and returns a lazy iterator with the results.
๐ŸŒ
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 - If additional iterable arguments are passed, 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. Bingo!
๐ŸŒ
Kanaries
docs.kanaries.net โ€บ topics โ€บ Python โ€บ python-map-function
Python map() Function: Transform Iterables with Examples โ€“ Kanaries
February 10, 2026 - The Python map() function is a precise tool for a specific job: applying a single function to every element of an iterable without writing a loop. It excels when paired with built-in functions like int, str, float, and len, where it produces the most readable and fastest code.
๐ŸŒ
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 - The map() function can accept multiple iterables. If you provide multiple iterables, the function you pass to map() must accept the same number of arguments as there are iterables.
๐ŸŒ
Real Python
realpython.com โ€บ lessons โ€บ mapping-values-iterables
Mapping Values and Iterables (Video) โ€“ Real Python
03:59 Passing str as my callable ... result is an iterable of strings which join() can then use to do its work. You can also give map() two iterables....
Published: December 9, 2025
๐ŸŒ
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.
Published: October 23, 2024
๐ŸŒ
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)
๐ŸŒ
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 - Passing multiple arguments to the map() function is simple once you understand how to do it. You simply pass additional iterables after the function argument, and map() will take items from each iterable and pass them as separate arguments to the function.
๐ŸŒ
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 - 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.
๐ŸŒ
Bobby Hadz
bobbyhadz.com โ€บ blog โ€บ python-map-with-multiple-arguments
Pass multiple arguments to the map() function in Python | bobbyhadz
April 8, 2024 - The map() function takes a function and one or more iterables as arguments and calls the function with each item of the iterables. The map() function first called the multiply() function with the numbers 1 and 6, then with the numbers 2 and 7, etc.
๐ŸŒ
Learn Coding Fast
learncodingfast.com โ€บ home โ€บ python map() function โ€“ how to map a function with multiple arguments
Python map() function โ€“ How to map a function with multiple arguments | Learn Coding Fast
November 6, 2020 - To map a function with multiple arguments in Python, we need to pass multiple iterables to the map() function. In today's post, we'll learn toโ€ฆ