various python challenges from Think Python and elsewhere