I don't know why it still printing Arizona, and not raising a ValueError.The function also needs to be able to take Arizona in any case mix for example "ArIzOna" in the argument.
def raising_arizona(string):
try:
print(string)
return True
except:
if string.upper() == 'Arizona' or string.lower() == 'arizona':
raise ValueError
return False
raising_arizona('Arizona')
I tried using an if statement in order for Arizona to be case-mixed by saying the string will be taken whether its lower or upper case.