+ 7

Why should I use map function instead of list comprehension?

Hello.So I recently learned about map function and it looks like most of its functions can be done with list comprehension as well.Is there any reason why we use map function or is just another way to change values in the list?Thank you

29th May 2019, 3:48 PM
Flori Hiso
Flori Hiso - avatar
1 Odpowiedź
+ 8
From my side i use both - it depends on the situation i have to handle. But here are some really nice statements, but you have to read it up to the end. https://stackoverflow.com/questions/1247486/list-comprehension-vs-map#1247490
29th May 2019, 5:26 PM
Lothar
Lothar - avatar