列表拼接

import re
li = [1, 2, 3, 4, 5, 66, 7, 3, 54, 34, 34]

# s = ''.join(str(li).split(',')).replace(' ', '').replace('[','').replace(']','')
s = re.sub('[s[]]', '', ''.join(str(li).split(',')))
print(s)

原文地址:https://www.cnblogs.com/fmgao-technology/p/9145476.html