0
What is "x" and "y" in the code below?
k = list(map(lambda x, y:x+y, list(range(100)), list(range(12)))) print (len(k))
2 Antworten
+ 2
here is the definition of 'map' function
https://docs.python.org/3/library/functions.html#map
which says
With multiple iterables, the iterator stops when the shortest iterable is exhausted.
So, x will be 0,1,...,11 from 'list(range(100))',
and y will be 0,1,...,11 from 'list(range(12))'.
0
Wow, thanks ♥️