Question #292909

given an integer N, write a program that prints the count of the total numbers of digits between 1 and N.


Expert's answer

def digits(N):
    st = ""
    for i in range(1, N + 1):
        st += str(i)

    print(len(st))
N = 111
digits(N)
LATEST TUTORIALS
APPROVED BY CLIENTS