利用下划线将列表的每个元素拼接成字符串,li=["alex","eric","rain"]
li=[‘alex‘, ‘eric‘, ‘rain‘] c = li[0] for k,n in enumerate(li[1:]): c += "_"+n print(c)
原文地址:https://www.cnblogs.com/riling/p/10133147.html
时间: 2024-10-07 02:33:04
利用下划线将列表的每个元素拼接成字符串,li=["alex","eric","rain"]
li=[‘alex‘, ‘eric‘, ‘rain‘] c = li[0] for k,n in enumerate(li[1:]): c += "_"+n print(c)
原文地址:https://www.cnblogs.com/riling/p/10133147.html