Raising exceptions

Report a typo

Create a function sum_with_exceptions(a, b) that will add two integers. If the sum is negative, it should raise an error called NegativeSumError that you should define by yourself. If the sum is positive or 0, the function should return the sum.

Tip: You do not have to handle the exception using the try-except block; just raise it.

Write a program in Python 3
def sum_with_exceptions(a, b):
...
___

Create a free account to access the full topic