I am new to Python, so I might be missing something simple.
I am given an example:
string = \"The , world , is , a , happy , place \"
Try using the split
function.
In your example:
string = "The , world , is , a , happy , place "
array = string.split(",")
for word in array:
print word
Your approach failed because you indexed it to yield the string from beginning until the first ",". This could work if you then index it from that first "," to the next "," and iterate across the string that way. Split would work out much better though.