Dumb python questions

Joal Heagney s713221 at student.gu.edu.au
Fri Aug 17 16:15:26 CEST 2001


Paul Rubin wrote:
> 
> Joal Heagney <s713221 at student.gu.edu.au> writes:
> > Out of curiosity, is there a reason (e.g. curiosity on your part?)
> > you're not using:
> >
> > N = 100
> > sum = N*(N+1)/2
> >
> > which returns the sum of the first 100 integers much more quickly?
> 
> It was just a simple example to illustrate my question about how the
> range function worked.  Of course I wouldn't code it that way in real
> life.

I kinda thought that was what it was. *evil grin* And I should HOPE not!
-- 
      Joal Heagney is: _____           _____
   /\ _     __   __ _    |     | _  ___  |
  /__\|\  ||   ||__ |\  || |___|/_\|___] |
 /    \ \_||__ ||___| \_|! |   |   \   \ !



More information about the Python-list mailing list