본문 바로가기

List comprehension vs. map

 

 

List comprehension vs map

Is there a reason to prefer using map() over list comprehension or vice versa? Is either of them generally more efficient or considered generally more Pythonic than the other?

stackoverflow.com

람다 없이 같은 함수를 쓴다면 map이 조금 더 빠르고,

람다로 함수를 선언한다면 list comprehension이 조금 더 빠르다.