function returning a list

Rick Holbert holbertr at dma.org
Wed Sep 1 21:09:37 CEST 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