On Thu, Apr 24, 2008 at 11:13:31PM +0300, kinuthia muchane wrote:
>       return sum([k*k for k in range(1,111)])# sum of the squares of the
> first one hundred numbers

Wouldn't the first hundred numbers be range(1,101)?

> def aux1():
>       inter = sum([k for k in range(1,111))# square of the sum of the first

why use the list comprehension here, instead of simply saying:

    return sum(range(1,101) ** 2


-- 
Steve Willoughby    |  Using billion-dollar satellites
[EMAIL PROTECTED]   |  to hunt for Tupperware.
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to