- join()方法
sequence要连接的元素序列str.join(sequence)
返回通过指定字符连接序列中元素后生成的新字符串
如下面代码
seq = ['127','0','0','1']
str1 = '.'
str2 = str1.join(seq)
print str2
127.0.0.1
str.join(sequence)
sequence要连接的元素序列
seq = ['127','0','0','1']
str1 = '.'
str2 = str1.join(seq)
print str2
127.0.0.1