[newbie] making rows of table with discrete values for different number systems

Jean Dupont jeandupont314 at gmail.com
Mon Feb 3 14:37:36 EST 2014


Op maandag 3 februari 2014 16:34:18 UTC+1 schreef Asaf Las:
> On Monday, February 3, 2014 5:05:40 PM UTC+2, Jean Dupont wrote:
> > Op maandag 3 februari 2014 02:56:43 UTC+1 schreef Asaf Las:
> > 
> > > On Sunday, February 2, 2014 10:51:15 PM UTC+2, Jean Dupont wrote:
> > > > Op zondag 2 februari 2014 19:10:32 UTC+1 schreef Peter Otten:
> > > > I'm looking for an efficient method to produce rows of tables like this: 
> > > > jean
> > 
> > > you can also try to make below universal for all needed bases: 
> > > m = lambda m, n: 1 if m & n else 0
> > > k = [[ m(x,8) , m(x, 4), m(x, 2), m(x, 1)] for x in range(10)]
> > 
> > > print (k)
> > 
> > Dear Asaf,
> > I'm not at ease with lamba-notation, could you show me how to modify your
> > example for the base 3 case? I guess then it will be much clearer to me
> > thanks in advance
> > 
> > jean
>
> I don't have to - use normal functions instead :-)
Of course you don't have to, but I'm curious and learn well by examples

:-(



More information about the Python-list mailing list