[Tutor] Alan Gauld's tut - namespaces

Payal Rathod payal-python at scriptkitchen.com
Wed Apr 26 19:41:59 CEST 2006


Hi,
In Alan's tutorial I haven't got the example of print42() even after 
reading the explanation.
I get 110 if I use it as a function.

>>> spam = 42
>>> def print42(): print spam
...
>>> spam = 110
>>> print42()
110

Why do you get 42 when you use it as module? I haven't understood the 
explantaion.

With warm regards,
-Payal


More information about the Tutor mailing list