Check out example codes for "python count number of digits in integer". It will help you in understanding the concepts better.

Code Example 1

import math
digits = int(math.log10(n))+1

Code Example 2

n = 1234 //Any Random Number
digits = len(str(n)) //Saves the number of digits of n into the variable digits

Learn ReactJs, React Native from akashmittal.com