>    >     okay, i tried. so why are globals bad and what problems
>    > do they solve?

The biggest complaint I have with the original example is that you've
writen code to "do stuff" with array G, yet that code cannot directly
be used to do the same stuff to some other array.  In this sense, the
code is not reusable.  If it accepted G as a parameter, then it would
be more general.

The main advantage of globals is convenience (for example, if all you
care about is getting this particular program working as soon as
possible).

With regard,
Michael








_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to