Complete Exercise 6 in Chapter 9 of Think Python