That book has the worst Python code ever in a print publication.
In its defense, I think the Python code was written to be readable, rather than necessarily idiomatic. I started doing the exercises in Lua, and haven't had a hard time translating them thus far.
More critique at http://news.ycombinator.com/item?id=208895 if you'll chase the parent links.