Code snippets from Learn Python the Hard Way