RRoot's homework solution to week 4 of the summer Python course