Exception Handeling
try:
something
raise Exception #throw an exception explicitly
except (FileNotFoundError, OtherError, ...) as e:
print(e)
except Exception as e: #parent exception
print(e)
else:
print("if none of above Exception(s) occured, then this block will run")
finally:
print("will run, no matter what (exception occurs or not)")
Note: The codes inside finally will be executed no matter whether there was an exception or not. If there is a "return" or "exit" inside the exception blocks, before returning or exiting, the finally codes will still be executed.