Answers for "python display singel part array"

4

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
Posted by: Guest on May-09-2020
1

print value of array python

visit = ['noah-', 'chatelain', '.fr']

print visit[0] # return string : 'noah-'
print visit[1] # return string : 'chatelain'
print visit[2] # return string : '.fr'

print 'go visit : ' + visit[0] + visit[1] + visit[2]
# return 'go visit : noah-chatelain.fr'
Posted by: Guest on March-19-2020

Code answers related to "python display singel part array"

Python Answers by Framework

Browse Popular Code Answers by Language