"Byte" <[EMAIL PROTECTED]> writes: > Probably a stupid question, but I'm a newbie and this really pisses me > off. Run this script: > > import random > > def Func1(): > choice = ('A', 'B', 'C') > output = random.choice(choice) > > def Func2(): > print output > > Func1() > Func2()
You could declare output to be global, but it's kind of poor style. Preferable is something like: def Func1(): choice = ('A', 'B', 'C') output = random.choice(choice) return output def Func2(x): print x output = Func1() # this "output" is not the same as the one in Func1 Func2(output) -- http://mail.python.org/mailman/listinfo/python-list