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)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS