Verzeichnis für teil28

This commit is contained in:
Olli Graf
2024-10-25 14:03:27 +02:00
parent af36c44e66
commit fec0969d7f
12 changed files with 2 additions and 0 deletions

13
teil28/counter.py Normal file
View File

@@ -0,0 +1,13 @@
#Datei: counter.py
def counter(func):
func.count = 0
def wrapper(*args, **kwargs):
func.count = func.count +1
print(f'{func.__name__} wurde {func.count}-mal aufgerufen.')
result = func(*args,**kwargs)
return result
wrapper.count = 0
return wrapper