return multiple values from fuction

Batista, Facundo FBatista at uniFON.com.ar
Thu Nov 6 21:04:50 CET 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