1. 程式人生 > >python-列表轉字符串

python-列表轉字符串

asd col 字符 IT python style clas print pri

#列表轉字符串(字符串加數字):
li = [11, 22, 33, "asd", "xyz", "879", "hello"]
s = ""
for item in li:
    s = s + str(item)
print(s)

#列表轉字符串(只有字符串):
li = ["ety", "xyz", "hello", "world"]
s = "".join(li)
print(s)

python-列表轉字符串