exercise 11 added

This commit is contained in:
heinleinju104093 committed 2026-11-12 12:12:21 +01:00
1 parent e9f9d24c96
commit dbf00aca26
1 file changed
+21
+21
View File
@@ -0,0 +1,21 @@
import functools
def run_once(f):
already_run = False
@functools.wraps(f)
def wrapper(*args, **kwargs):
nonlocal already_run
if not already_run:
already_run = True
return f(*args, **kwargs)
return wrapper
@run_once
def test():
print("Hello World!")
test()
test()