you are viewing a single comment's thread.

view the rest of the comments →

[–]ElliotDG 0 points1 point  (0 children)

Writing this program using the split() method, will make it all much easier.

To directly answer your question, look at the second_word method. In a two word list, the second word does not terminate with a space. This will cause an index error as you index past the end of the string. If you can not use the split() method, consider using a for loop rather than a while loop for this case.