首页 > 技术文章 > python 字符词串和字符串的转换

mdumpling 2017-12-19 19:49 原文

type(' i am ')

str
type(''.join('i am'))

str


''.join('sda sadaa')

'sda sadaa'

 

q=str('i am the teacher').split()
q

['i', 'am', 'the', 'teacher']

''.join(q)
'iamtheteacher'

推荐阅读