Answer to Question #292909 in Python for gayathri

Question #292909

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


1
Expert's answer
2022-02-02T12:48:46-0500
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS