Simple allowed call
Input
add(2, 3)
Output
5
Both arguments are non-negative integers, so the original function runs and returns their sum.
Full lesson preview
Write a decorator that prevents functions from running if any numeric argument is negative.
Problem statement
Task
Examples
Input
add(2, 3)
Output
5
Both arguments are non-negative integers, so the original function runs and returns their sum.
Input format
Output format
Constraints
Samples
Input
add(5, 7)
Output
12
Neither argument is negative; the decorator allows the call and the function returns 12.