printing list

Tim Chase python.list at tim.thechases.com
Sun May 7 18:35:24 CEST 2006


compboy wrote:
> How do you print elements of the list in one line?
> 
> alist = [1, 2, 5, 10, 15]
> 
> so it will be like this:
> 1, 2, 5, 10, 15

 >>> print ', '.join(alist)
1, 2, 5, 10, 15

-tkc









More information about the Python-list mailing list