天天看点

多字符串拼接

fruits = ['orange', 'apple', 'banana', 'pear']

','.join(fruits)

'orange,apple,banana,pear'

help(str.join)

join(...)
    S.join(iterable) -> str
    
    Return a string which is the concatenation of the strings in the
    iterable.  The separator between elements is S.      

继续阅读