# 如何将多个小字符串拼接成一个大的字符串 s1 = 'abcdefg' s2 = '12345' # s1 + s2 实际上调用的是 str.__add__(s1, s2) print(str.__add__(s1, s2)) print(s1 + s2) pl = ['<0112>', '<32>', '<1024x768>', '<60>', '<1>', '<100.0>', '<500.0>'] s = '' # 大量的字符串copy,存在浪费 for p in pl: s += p print(s) # 推荐 res = ''.join(pl) print(res) l = ['abc', 123, 45, 'xyz'] # 通过循环列表实现 # res = ''.join([str(x) for x in l]) # 将字符串和数组拼接成字符串,推荐方案 res = ''.join(str(x) for x in l) print(res)