How to write this decorator? : <p>HELP Please . How Write This Decorator (Take a validator if the validator return "True" send args to func :</p>

<pre><code>#define decorator here ...

def validator(x):
    return x&gt;=0

@decorator(validator)
def f(x):
    return x**0.5

print(f(4)) #should print 2
print(f(-4)) #should print error
</code></pre>
