function returning a list

Brad Tilley bradtilley at usa.net
Wed Sep 1 15:14:49 EDT 2004


Rick Holbert wrote:
> 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]
> 

Thanks guys, stupid question. I got it working.



More information about the Python-list mailing list