[EMAIL PROTECTED] (Bengt Richter) writes:
> or if the OP actually wants the specific function,
>  >>> def sum100a(f): return sum(imap(f, xrange(101)))
>  ...
>  >>> sum100a(square)
>  338350

Similarly with generator comprehension, if I have the syntax right:

   def sum100c(f): return sum(f(i) for i in xrange(101))
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to