How to use python change a string into list cut by ','? -


this question has answer here:

i have string

string_ = 'hello world, world, hello, stackoverflow, me, not, me' 

how change list this?

['hello world', 'world', 'hello', 'stackoverflow', 'me', 'not', 'me'] 

i have try

alist = list(string_) 

but when format alist shows

['h', 'e', 'l', ... ] 

this should trick:

alist = string_.split(', ') 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

dataset - MPAndroidchart returning no chart Data available -

post - imageshack API cURL -