Build a decorator that tracks how many times a function is called.
Constraints
Example
>>> @count_calls ... def add(a, b): ... return a + b >>> add(2, 3) 5 >>> add.call_count 1 >>> add(10, 20) 30 >>> add.call_count 2 >>> @count_calls ... def sum_three(a, b, c): ... return a + b + c >>> sum_three(1, 2, 3) 6 >>> sum_three.call_count 1
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints