The problem is simple, we need to write a program in python to count the number of digits in a given number.

Steps to Count Number of Digits in Python

  1. Input a number.
  2. Run while loop with condition num>0.
  3. Increment count with 1 and update num by removing last digit i.e num=num//10.
  4. End loop and output count.

Python Program

Output

Count number of digits in python

If you have any suggestion or doubt then comment below.

Close Menu