python 输出列表去掉中括号

tech2024-04-17  69

还以为有更高级的办法,结果就是遍历

list1 = [19, 20, 21] list2 = ['19', '20', '21'] print(list1) print(list2) list1 = ','.join(str(i) for i in list1) list2 = ','.join(str(i) for i in list2) print(list1) print(list2)

 

最新回复(0)