python chapter 4 exercises