Think Python ch18 ex5