lambda (and reduce) are valuable

Paul Rubin http
Mon Dec 12 06:37:41 EST 2005


bokr at oz.net (Bengt Richter) writes:
> 
>     for tup in ((str(d+1), d%3+1,3-d//3) for d in xrange(9)): digit(*tup)
> 
> tweak 'til correct ;-)

GMTA.  See:

  http://www.nightsong.com/phr/python/calc.py

written a couple years ago.  It uses:

    for i in xrange(1,10):
        add_button(5+2-(i-1)/3, (i-1)%3, str(i))



More information about the Python-list mailing list