diff --git a/app/main.py b/app/main.py index 68287892..5def11c2 100644 --- a/app/main.py +++ b/app/main.py @@ -2,5 +2,15 @@ def cache(func: Callable) -> Callable: - # Write your code here - pass + cache_list = {} + + def storage(*args, **kwargs) -> int: + if args not in cache_list.keys(): + cache_list[args] = func(*args, **kwargs) + print("Calculating new result") + else: + print("Getting from cache") + + return cache_list[args] + + return storage