Python-字符串

split() 和splitlines()

>>>string = 'I learning Python' 

>>>string.split()               
['I', 'learning', 'Python']

>>>string.splitlines()          
['I learning Python']

jion()

>>>string = 'I learning Python'       
>>>'@'.join(string)                   
'I@ @l@e@a@r@n@i@n@g@ @P@y@t@h@o@n'

>>>list= ['I', 'learning', 'Python']  
>>>'@'.join(list)                     
'I@learning@Python'

 

posted @ 2019-05-27 16:52  垃圾制造机  阅读(139)  评论(0编辑  收藏  举报