python list slicing error : Can someone help me with my code?

I am just starting out my question is this:

in this code: https://pastebin.com/mQkpxdeV

        wordlist[overticker] = thesentence[0:spaces]

I can't figure out why it just keeps saying list index out of range?

The program seems to work but it gives an error, what am I doing wrong please help I am on a deadline(it's a long story)

I have looked through this book by mark lutz for an answer and I can't find one