diff --git a/Code to count the digits b/Code to count the digits new file mode 100644 index 0000000..db25927 --- /dev/null +++ b/Code to count the digits @@ -0,0 +1,10 @@ +import math + +def countDigit(n): + return math.floor(math.log(n, 10)+1) + +# Driver Code +n = 345289467 +# if want user input +# n = int(input()) +print ("Number of digits : % d"%(countDigit(n)))