Answer to Question #302434 in Python for reyadf

Question #302434

Write a Python program that takes a number and prints how many digits are in that number.


[Consider the input number to be an INTEGER.]



[You are not allowed to use len() function]



Example: If the user gives 9876, your program should print 4.

1
Expert's answer
2022-02-27T05:13:17-0500
n = input('Enter number here:' )
j = 0
for i in n:
    j = j + 1
print(j)

Enter number here:9876
4

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