Find the number of digits between 1 to N
example:
and so on...
def findDigits(N):
if N == 1:
return 1
# changing number to string
s = str(N)
# Add length of number to total return len(s) + findDigits(N -
# Driver code
# Given N
N = 13
# Function call
print (findDigits(N))
Output: 17
Comments
Leave a comment