本文共 265 字,大约阅读时间需要 1 分钟。
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.
转载地址:http://swdeo.baihongyu.com/