Python and Schools

Greg Brondo greg at
Tue Apr 15 21:07:27 CEST 2003

Aahz wrote:
> In article <v9e21mhemm8c2 at>,
> Paul Watson <pwatson at> wrote:
>>We need to teach students correct design priciples to build something
>>greater than what already exists.  We will never get very far if we
>>require everyone to start with a quark or atom.  Yes, of course we need
>>some people who design silicon and create microcode.  They will learn
>>the low-level details what they need to know as they need it.  Knowing
>>great design and organization principles will enable them to make the
>>most of it.
> While there's some truth to that, try explaining why the following code
> is a Bad Idea to someone who has no basic understanding of CS:
>     s = ''
>     for i in range(1000000):
>         s += str(i)
> Knowing the difference between O(N) and O(N^2) is critical to writing
> even the simplest programs.  OTOH, I do agree with you that focusing on
> programming as a craft is more important to being a programmer than
> learning CS.

I understand why the code is bad (copying the string each time in
memory as it grows).  However, I've never understood the notation's
O(N) and O(N2)?

Greg Brondo

More information about the Python-list mailing list