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)本文共 260 字,大约阅读时间需要 1 分钟。
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