字符串拼接

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)   轉載於:https://www.cnblogs.com/ray-mmss/p/1
相關文章
相關標籤/搜索