Byte wrote:
> Now what do I do if Func1() has multiple outputs and Func2() requires
> them all to give its own output, as follows:

You can return them as a tuple:

 >>> def func1():
        output1 = 'hi'
        output2 = 'bye'
        return (output1, output2)

 >>> def func2(data):
        print data

 >>> func2(func1())
('hi', 'bye')


> def Func1():
>     choice = ('A', 'B', 'C')
>     output = random.choice(choice)
>     output2 = random.choice(choice)
>     return output
>     return output2

Only the first return statement would run in that code.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to