結果 : function to count digits in python