def memo(func):
    cache = {}
    @wraps(func)
    def wrap(*args):
        if args not in cache:
            cache[args] = func(*args)
        return cache[args]
    return wrap
an example of dynamic programming using a memoizing decorator
dataset/ETHPy150Open bt3gl/Python-and-Algorithms-and-Data-Structures/src/USEFUL/dynamic_programming/memo.py/memo