count digits python code