Homework for week 5 of Programming with Python