Importing an output from another function
James Stroud
jstroud at mbi.ucla-dot-edu.no-spam.invalid
Fri Mar 17 18:44:28 EST 2006
John Salerno wrote:
> James Stroud wrote:
>
> Try this (I think its called "argument expansion", but I really
don't
> know what its called, so I can't point you to docs):
>
> def Func1():
> choice = ('A', 'B', 'C')
> output = random.choice(choice)
> output2 = random.choice(choice)
> return output, output2
>
> def Func2(*items):
> print items
>
> output = Func1()
> Func2(*output1)
>
>
> I was wondering about '*items' when I wrote my response. I left out
the
> asterisk in my version and it still seems to work. Is it necessary?
>
Yours is better, after I wrote mine, I realized the asterisk was
unnecessary for this particular example, except that it makes Func2
more
general.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
More information about the Python-list
mailing list