Re: [Tutor] Demystification of Lambda Functions

2015-10-28 Thread Peter Otten
Steven D'Aprano wrote: > Sometimes callbacks are particularly short and simple. Suppose you are > programming a calculator, and you have ten buttons 0...9 which all do > precisely the same thing: they add their own name to the calculator > display: > > > for num in range(0, 10): > btn = B

Re: [Tutor] Demystification of Lambda Functions

2015-10-28 Thread Steven D'Aprano
On Tue, Oct 27, 2015 at 09:04:45PM -0400, Hunter Jozwiak wrote: > Hello, > > I am not sure exactly why there would be a practical use for a lambda > function, other than the fact that you can make one-liner functions that > take parameters in to a variable. Or at least that is how things look when

Re: [Tutor] Demystification of Lambda Functions

2015-10-28 Thread Anshu Kumar
Hi, Lambda or anonymous function is core of functional programming which was not in java. With lambda you can pass not just define an anonymous function but can pass them to other functions which really makes life easier. You would like to read http://www.python-course.eu/lambda.php http://www.p

Re: [Tutor] Demystification of Lambda Functions

2015-10-28 Thread Alan Gauld
On 28/10/15 01:04, Hunter Jozwiak wrote: I am not sure exactly why there would be a practical use for a lambda function, other than the fact that you can make one-liner functions that take parameters in to a variable. Or at least that is how things look when they are written. Can I have some dem

Re: [Tutor] Demystification of Lambda Functions

2015-10-28 Thread Laura Creighton
In a message of Tue, 27 Oct 2015 21:04:45 -0400, "Hunter Jozwiak" writes: >Hello, > > > >I am not sure exactly why there would be a practical use for a lambda >function, other than the fact that you can make one-liner functions that >take parameters in to a variable. Or at least that is how things

[Tutor] Demystification of Lambda Functions

2015-10-28 Thread Hunter Jozwiak
Hello, I am not sure exactly why there would be a practical use for a lambda function, other than the fact that you can make one-liner functions that take parameters in to a variable. Or at least that is how things look when they are written. Can I have some demystification? Thanks, Hun