Re: [Tutor] Explanation of this lambda

2007-03-01 Thread Eric Brunson
$.02, e. > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf > Of Alan Gauld > Sent: 22 February 2007 11:46 AM > To: tutor@python.org > Subject: Re: [Tutor] Explanation of this lambda > > > "Johan Geldenhuys" <[EMAIL

Re: [Tutor] Explanation of this lambda

2007-02-22 Thread Johan Geldenhuys
t: Re: [Tutor] Explanation of this lambda "Johan Geldenhuys" <[EMAIL PROTECTED]> wrote > Would somebody care to explain what is happening in this process? > > def intToBin(self, x, count=8): >return "".join(map(lambda y:str((x>>y)&1), range(c

Re: [Tutor] Explanation of this lambda

2007-02-22 Thread Alan Gauld
"Johan Geldenhuys" <[EMAIL PROTECTED]> wrote > Would somebody care to explain what is happening in this process? > > def intToBin(self, x, count=8): >return "".join(map(lambda y:str((x>>y)&1), > range(count-1, -1, -1))) "".join() turns a list into a string map() returns a list where e

Re: [Tutor] Explanation of this lambda CORRECTION

2007-02-21 Thread Bob Gailer
Bob Gailer wrote: I just noticed missing ) in the last 2 statements. Fixed below. Johan Geldenhuys wrote: Hi all,   I found this function that converts a integer into a 8 bit binary string.   Would somebody care to explain what is happening in this process?

Re: [Tutor] Explanation of this lambda

2007-02-21 Thread Bob Gailer
Johan Geldenhuys wrote: Hi all,   I found this function that converts a integer into a 8 bit binary string.   Would somebody care to explain what is happening in this process?       def intToBin(self, x, count=8): """ Parameters: `x`: integer     Returns a 8 bit