Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Python documentation suggests that you can simply add other parameters when raising the Exception and retrieve them using args: Code try: raise Exception('spam', 'eggs') except Exception as in...
Answer
#1: Initial revision
[Python documentation](https://docs.python.org/3/tutorial/errors.html) suggests that you can simply add other parameters when raising the Exception and retrieve them using args: ### Code ```python try: raise Exception('spam', 'eggs') except Exception as inst: print(inst.args) # arguments stored in .args x, y = inst.args # unpack args print('x =', x) print('y =', y) ``` ### Output ``` ('spam', 'eggs') x = spam y = eggs ```