Write a python function to Count the Number of Digits in a Number


Topic: Write a python function to Count the Number of Digits in a Number

Solution

def count_digits():
    n = int(input("Enter number:"))
    count = 0
    while n > 0:
        count = count + 1
        n = n // 10
    return count



List all Python Programs