补充
#将字符串变成列表
s = "jack_li_mac_c"
lst = s.split("_")
print(lst)
#将列表变成字符串
lst =['jack', 'li', 'mac', 'c']
s = "_".join(lst)
print(s)
方法二
#将列表变成字符串
lst =['jack', 'li', 'mac', 'c']
# s = "_".join(lst)
result = ""
for el in lst:#每一个元素
result = result + el +"_"
print(result.strip("_"))