built-in least-recently used cache decorator import functools @functools lru_cache(maxsize= typed=falsedef fib( )if return elsereturn fib( - fib( - static variables in [ ]exercise write decorator counting the number of times function was called the same but for varying number of parameters and keyword-arguments def counter(func)first define function def helper( *args**kwargs)helper count + return func( *args**kwargsreturn function as it is thendefine an attribute to be incremented with every call this attribute behaves like static variable helper exist only after the function definition once definedthen we can attach an attribute helper count return helper @counter def fun( )return fun( fun( fun( fun count out[ ] generators in [ ] "pythonitero iter(sitero what write isfor char in swhat python doesfor char in iter(sin fact it is while loop until stop is reached out[ ]in [ ]next(iteroout[ ]'