Write a function to count the number of digits in a number


Topic: Write a function to count the number of digits in a number

Solution

def count_digits(n):
    return len(str(n))



List all Python Programs