"Devon MacIntyre" <[EMAIL PROTECTED]> wrote

> Just wondering, how would I get a variable out of one function and 
> into
> another?

return the value from one function and pass it as an argument to the 
other.
Example:

def oneFunction()
     x = [1,2,3]
     return x

def another(aValue):
     print aValue


def main():
    myList = oneFunction()
    another(myList)

Does that make any kind of sense to you?
For more on functions and arguments and parameter passing
see my tutorial topic on Modules and functions.

> called 'new_game()'. Also, I'm using a Mac, but I'm not sure if that 
> affects
> the code or not.

Nope, the Mac makes no difference whatsoever in this situation. :-)


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 


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

Reply via email to