- 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