Write a function to print the count of divisor.


Topic: Write a function to print the count of divisor.

Solution

def divisor_count(num: int):
    """
    function to count the number of divisor of interger.
    """
    if isinstance(num, int):
        count = 0
        for i in range(1, num+1):
            if num%i == 0:
                count = count+1
        print(f'Number of divisor is {count}')
    else:
        raise ValueError('Invalid Input')



List all Python Programs