Programming Examples
Python program to count the number of digits in given number
Write a python program to accept a integer number and count the number of digits in number.
Sample:
Input: 2223
Output: Number of Digits: 4
Solution
num=int(input("Enter any Number : "))
count=0
while num>0:
count+=1
num=num//10
print("Number of Digit : ",count)
Output
Enter any Number : 2342
Number of Digit : 4