string.join(iterable)

  str.join(iterable)

Return a string which is concatenation the  of the strings in the iterable iterable. The separator between elements is the string providing this method.

返回一个以str为间隔,元素是iterable里元素。

>>> a=['a','b','c']
>>> a
['a', 'b', 'c']
>>> ''.join(a)
'abc'
>>> ' '.join(a)
'a b c'

>>> 's'.join(a)
'asbsc'

 
原文地址:https://www.cnblogs.com/caizhenzhen/p/5094176.html