Program - function counter to store the number of times multiples function called in a dictionary


Topic: Program - function counter to store the number of times multiples function called in a dictionary

Solution

def count_func_dict(fn: "Function Name"):
    count = 0
    def inner(*args, **kwargs):
        nonlocal count
        count =+= 1
        counter_67[fn.__name__] = count
        return fn(*args, **kwargs)
    return inner



List all Python Programs