Python(34)_join()方法

Posted sunnybowen

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python(34)_join()方法相关的知识,希望对你有一定的参考价值。

#-*-coding:utf-8-*-
\'\'\'

\'\'\'
# join方法,,后面有用,爬之前就是用这个方法拼接的,虽然后来调用了方法自己拼接
# str,字典,列表,元组
s = \'bowen\'
s1 = \'_\'.join(s)
print(s1)

# 列表转换成字符串 join()
# 字符串转换成列表 split()
li = [\'bowen1\',\'bowen2\',\'bowen3\']
s = \'#\'.join(li)
print(s)

 

以上是关于Python(34)_join()方法的主要内容,如果未能解决你的问题,请参考以下文章