IndexError: list index out of range when trying to solve Python for Everybody Exercise 10.2

visit shbcf.ru