return multiple objects

Vincent Davis vincent at
Fri Feb 6 04:03:01 CET 2009

Is it correct that if I want to return multiple objects from a function I
need to in some way combine them?
def test1():
    a = [1,3,5,7]
    b = [2,4,6,8]
   return a, b # this does not work?
   return [a, b] # does not work?
   return c # this works but I don't like it, , is there a better way?

I saw examples where dictionaries where used but I would prefer to
just access the object names directly. As in

print a # not haing to refer to it as

is there something I am missing?

Vincent Davis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list