0
Q:

python count number of digits in integer

n = 1234 //Any Random Number
digits = len(str(n)) //Saves the number of digits of n into the variable digits
2
import math
digits = int(math.log10(n))+1
2

New to Communities?

Join the community