Terry Reedy <[EMAIL PROTECTED]> wrote:

>> [['Fizz', 'Buzz', 'FizzBuzz', str(i)][62/(pow(i, 4, 15) + 1)%4] for i
>> in xrange(1, 101)]
> 
> These make the lookup table variable, so it has to be recalculated for
> each i.
> 
So what? Mark Wooding was posting about mathematical elegance and came up 
with that really neat pow() call. If runtime came into it then one of the 
previous solutions or (as Mark already said) a straightforward sometable[i%
15] is going beat something like this hands-down.

This is coding for fun not profit.

-- 
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to