Osio 4. Luku 4
single
Challenge: Conditional Decorator
Pyyhkäise näyttääksesi valikon
Tehtävä
Pyyhkäise aloittaaksesi koodauksen
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.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 4. Luku 4
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme