Exercises from Think Python book