Example 1 from Learn Python the Hard Way