Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to print items in a list in a single line python

>>> l = [1, 2, 3]
>>> print(' '.join(str(x) for x in l))
1 2 3
>>> print(' '.join(map(str, l)))
1 2 3
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #print #items #list #single #line #python
ADD COMMENT
Topic
Name
8+5 =