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'

 

 

posted on 2016-01-02 10:09  保质期两天  阅读(368)  评论(0编辑  收藏  举报