return multiple values from fuction

Batista, Facundo FBatista at uniFON.com.ar
Thu Nov 6 15:04:50 EST 2003


Lupe 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 f():
	return (1, 2)

>>> (a, b) = f()
>>> a
1
>>> b
2
>>> 

.	Facundo





More information about the Python-list mailing list