Sectie 4. Hoofdstuk 1
single
Challenge: Argument Validation Decorator
Veeg om het menu te tonen
Taak
Swipe to start coding
Create a decorator named positive_integer_args that checks all arguments passed to a function. The decorator must ensure every argument (both positional and keyword) is a positive integer. If any argument is not a positive integer, the decorator should raise a ValueError. Only if all arguments are valid should the original function execute.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 4. Hoofdstuk 1
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.