Write a Python program to count the number of digits in an integer.
number = 9923
def count_digits(number):
    count = 0
    while (number != 0): 
        count=count+1
        number = number//10
    return count