Answer
We can use raise and assert statements to raise custom exceptions in python. For example the below function will raise an exception if age is negative-
def fun(age):
$\quad$ if age<0:
$\quad$ $\quad$ raise Exception("Age can not be Negative")
Work Step by Step
Same as above.