return multiple values from fuction

Jay O'Connor joconnor at cybermesa.com
Thu Nov 6 21:03:23 CET 2003


On Thu, 06 Nov 2003 19:58:55 +0000, Lupe <luis_ at iname.com> wrote:

>hi, if someone can help me I would be grateful
>
>when I do
>
>def function
>        kjklj
>        llklç
>        
>        return variableA, variableB
>
>how can I assign the two return values to two distinct variables, as for ex.
>
>varC = variableA
>varD = variableB
>
>??
>
>
def test ():
	...
	return variableA, variableN
	

varC, vardD = test()

varC will contain variableA
varD ill contain variableB






More information about the Python-list mailing list