Monty @ The Python Coding Place @thepythoncodingplace.com · Mar 15

Therefore, you need a variable defined within the closure—a variable defined within the outer function `limit_to_three_uses()`. The inner function `wrapper()` will have access to this variable. See Day 1 in the series to refresh your memory on closures

0 likes 1 replies

?

Replies

Monty @ The Python Coding Place · Mar 15

Now, you can use this variable, `counter`, to decide whether to call the function `func()` or not, depending on how many times the function has been used already: