exercises from How to Think Like a Computer Scientist (Python Interactive Edition)