excercies from Mark Pilgrim's book 'Dive into Python'