Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

Comprehensions vs Lambdas

I keep reading things that sound like comprehensions replace lambdas. As one example, states "[List comprehension] is also a substitute for the lambda function as well as the functions map(), filter() and reduce(). Some people find it a more pythonic way of writing functions and find it easier to understand." Now, I understand that they work for sets, dictionaries, and generators as well. Speed aside, can comprehensions replace any and all abilities that lamdas have? Or only a small percentage?
1 Reply
Copilot Lvl 2
Message 2 of 2

Re: Comprehensions vs Lambdas

Does nobody know?