I am working on a deduct amount function and it should raise a run time error if a < b in value:
here is my code
def deduct_amount(a, b):
try:
b - a < 0
except ValueError:
print(a + ' can not be less than' + b)
else:
c = a - b
return c
deduct_amount(8, 12)
I know my try statement is faulty. how can I throw a value error if a is less than b