function returning a list

Rick Holbert holbertr at dma.org
Wed Sep 1 15:09:37 EDT 2004


Brad Tilley wrote:

> Can a function return a list?

Yes

>>> def return_list():
...     list = [1, 2, 3]
...     return list
...
>>> l = return_list()
>>> l
[1, 2, 3]




More information about the Python-list mailing list