Sectie 4. Hoofdstuk 4
single
Challenge: Conditional Decorator
Veeg om het menu te tonen
Taak
Veeg om te beginnen met coderen
Write a parameterized decorator that only allows a function to run if a given argument is True.
- If the parameter to the decorator is
True, call the decorated function and return its result. - If the parameter to the decorator is
False, do not call the decorated function andreturn Noneinstead. - Do not forget to return
decoratorandwrapperfunctions.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 4. Hoofdstuk 4
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.