>>> ls1 = [‘a‘, 1, ‘b‘, 2] >>> ls2 = [str(i) for i in ls1] >>> ls2 [‘a‘, ‘1‘, ‘b‘, ‘2‘] >>> ls3 = ‘‘.join(ls2) >>> ls3 ‘a1b2‘
时间: 2024-10-25 14:14:33
>>> ls1 = [‘a‘, 1, ‘b‘, 2] >>> ls2 = [str(i) for i in ls1] >>> ls2 [‘a‘, ‘1‘, ‘b‘, ‘2‘] >>> ls3 = ‘‘.join(ls2) >>> ls3 ‘a1b2‘