I'm trying to grasp my head around try/except. Please see code below....
status = raw_input('What is your status?')
#if x is anything other othan "citizen", "legal", or "illegal" raise a ValueError
try:
status == "citizen" or status == "legal" or status == "illegal"
except:
raise ValueError
So, I want to raise a ValueError if the user inputs anything other than what is specified, which doesn't happen. I know I can just use an If statement and raise a ValueError that way. But why would this not work also. Should the code not jump the except block if anything within the Try block is False?