[Tutor] Print text position problems when using triple quotes

Bill Mill bill.mill at gmail.com
Thu Feb 24 20:51:35 CET 2005

On Thu, 24 Feb 2005 14:23:28 -0500, Kent Johnson <kent37 at tds.net> wrote:
> Bill Mill wrote:
> >>class foo:
> >>    def bar(self):
> >
> >
> > Sorry, I forgot that if it's in the module, you should declare prompt1
> > as global by using "global prompt1" right here.
> >
> >
> >>        print prompt1 % (var1, var2, var3)
> No, you only need the global statement if you want to assign to a global variable. Read-only
> reference will work without the global.

This is correct. I do it for myself, just to be as explicit as
possible about it, since it's something I don't like to do. Putting
the strings into another module is really a much better solution.

Thanks for the correction.

Bill Mill
bill.mill at gmail.com

More information about the Tutor mailing list