字符串拼接

pl = ['a','b','c','d']
s = ''

for p in pl:
    s += p
print(s)


# 推荐使用
l =  ['abc', 123,45,'xyz']
res = ''.join(str(x) for x in l) # 引号里面时拼接符号
print(res)   

 

posted @ 2019-03-03 15:15  Ray_chen  阅读(146)  评论(0编辑  收藏  举报