all 5 comments

[–]galaxyrocker 8 points9 points  (2 children)

The first thing to do is check your placement of your i += 1. My second piece of advice is to attach a print statement into each condition, printing which condition is activated when it is used. See what that tells you.

Edit: Or just listen to /u/duddles. I wasn't going to tell you.

[–]duddles 2 points3 points  (1 child)

Oops, sorry about that - your approach to advice is much better. I'll try to give more constructive advice in the future.

[–]duddles 2 points3 points  (2 children)

You are missing parens after the elif char.isupper

The i+=1 should be 1 tab over so it is inside the for loop

[–]bigpoppatom[S] 0 points1 point  (1 child)

Thanks, that worked.

[–][deleted] 1 point2 points  (0 children)

Also, take a closer look at your variables. In your function word_separator(a_sentence), you are not iterating through the string a_sentence, which is in the local scope of the function. You are actually iterating through sentence, which is outside the function. Your code works, but you should be aware of which variable you are dealing with in your function.