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 -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -