标签:div pytho python列表 python 转换 字符串 highlight str pre
>>> ls1 = [‘a‘, 1, ‘b‘, 2] >>> ls2 = [str(i) for i in ls1] >>> ls2 [‘a‘, ‘1‘, ‘b‘, ‘2‘] >>> ls3 = ‘‘.join(ls2) >>> ls3 ‘a1b2‘
python列表中的所有值转换为字符串,以及列表拼接成一个字符串
标签:div pytho python列表 python 转换 字符串 highlight str pre
原文地址:https://www.cnblogs.com/kevenwork/p/10329634.html