Complete chapter 2 exercises of Think Python