Add characters (',') every time a certain character ( , )is encountered ? Python 2.7.3

Posted by draconisthe0ry on Stack Overflow See other posts from Stack Overflow or by draconisthe0ry
Published on 2012-08-27T02:54:17Z Indexed on 2012/11/05 17:01 UTC
Read the original article Hit count: 190

Filed under:
|
|

Let's say you had a string

test = 'wow, hello, how, are, you, doing'

and you wanted

full_list = ['wow','hello','how','are','you','doing']

i know you would start out with an empty list:

empty_list = []

and would create a for loop to append the items into a list

i'm just confused on how to go about this,

I was trying something along the lines of:

for i in test:
    if i == ',':

then I get stuck . . .

© Stack Overflow or respective owner

Related posts about python

Related posts about string