Python and a character count