return multiple values from fuction
Irmen de Jong
irmen at -NOSPAM-REMOVETHIS-xs4all.nl
Thu Nov 6 15:35:08 EST 2003
Alex Martelli wrote:
>>how can I assign the two return values to two distinct variables, as for
>>ex.
>>
>>varC = variableA
>>varD = variableB
>
>
> "just do it":
>
> varC, varD = function()
I like that comment... "just do it"...
I find this is also true for most other things
that you want to do in Python.
"How do I create a mapping between a person's last
name and the list of telephone numbers he/she can be
reached at?" -- "umm.. just do it?"
{ "de Jong": ['234234', '34562363'] }
or whatever ;-)
--Irmen
More information about the Python-list
mailing list