Global variables

Terry Reedy tjreedy at udel.edu
Tue Dec 10 12:07:59 EST 2002


"Richard Pasco" <richardpasco at quintessa.org> wrote in message
news:%LoJ9.2972$9R.10589195 at newsr2.u-net.net...
> As a relative newbie to programming in general I know what local and
global
> variables are, but I can't seem to get local ones back into my main
program.
> What exactly does the return function do?
> Does it "push" the variable into my main program?

Return is a statement.  Please read the docs (and the tutorial). Or
enter
>>> help('return')
at the interactive prompt.

>And then how can I get them into another function without
> making them global?

call the function directly, write the values into a mutable global, or
return them

TJR





More information about the Python-list mailing list