Home Python Python中string.join()的用法

Python中string.join()的用法

by zinan

>>> a=”abcd”
>>> “,”.join(a)
‘a,b,c,d’
>>> “,”.join([‘a’,’b’,’c’])
‘a,b,c’
>>> “,”.join((‘a’,’b’,’c’))
‘a,b,c’
>>> “,”.join({‘a’:1,’b’:2,’c’:3})
‘a,c,b’

打赏
0 comment

You may also like

Leave a Comment

*

code

error: Alert: Content is protected !!