[Tutor] Global presets ?

Alan Gauld alan.gauld at freenet.co.uk
Sun Dec 5 00:35:32 CET 2004


> >myvars.value2 = 'Alan'
> >
> >
> >
> Never thought of setting 'myvars.value2 = 'Alan''  I guess this
would
> just set the variable in the myvars namespace since it could not
change
> myvars.py itself.

Absolutely correct and why I put the example in - but I forgot
to point out the hidden gotcha! Glad you figured it out ;-)

> >print myvars.value1 - 27
> >
> >
> Have I misunderstood, should this not be 42 ? Typo or me not
understanding ?

value1 is 42 so the print statement prints 42-27 => 15

Just proving that you can use the values any way you like,
including in expressions.

Alan G.



More information about the Tutor mailing list