I have a homework assignment to instructs me to play around with functions and exceptions, but one seciton I'm stuck with is a certain condition it tells me to write
o if x is not "So sue me!", but x is still not convertible to an int (by calling int(x)), then raiser(x) raises a ValueError, without any requirements on the exception message.
So i tried the code below:
elif x != 'So sue me!' and x != int(x):
raise ValueError
Whenever I try to run the function with the statement
raiser('6') raises the ValueError,
raiser (6) allows the statement to pass
but the program is supposed to allow both the statements to pass...Do anyone know what I'm doing wrong? Any help will be apprciated and thanks for your time