example code from book dive into python