List to string

Jmnote (토론 | 기여)님의 2017년 10월 18일 (수) 15:47 판
list to string
array to string

Python

  • Python 2
Python
Copy
mylist = [10,"test",10.5]
print( type(mylist) )
print( mylist )
# <type 'list'>
# [10, 'test', 10.5]

mystr = str(mylist)
print( type(mystr) )
print( mystr )
# <type 'str'>
# [10, 'test', 10.5]