raising exceptions so farthe examples in this have reacted to exceptions something happens and the application provides error-handling support for that event howeversituations arise for which you may not know how to handle an error event during the application design process perhaps you can' even handle the error at particular level and need to pass it up to some other level to handle in shortin some situationsyour application must generate an exception this act is called raising (or sometimes throwingthe exception the following sections describe common scenarios in which you raise exceptions in specific ways raising exceptions during exceptional conditions the example in this section demonstrates how you raise simple xception -that it doesn' require anything special the following steps simply create the exception and then handle it immediately this example also appears with the downloadable source code as raiseexception py open python file window you see an editor in which you can type the example code type the following code into the window -pressing enter after each linetryraise valueerror except valueerrorprint("valueerror exception!"you wouldn' ever actually create code that looks like thisbut it shows you how raising an exception works at its most basic level in this casethe raise call appears within try except block basic raise call simply provides the name of the exception to raise (or throwyou can also provide arguments as part of the output to provide additional information notice that this try except block lacks an else clause because there is nothing to do after the call although you rarely use try except block in this manneryou can you may encounter situations like this one sometimes and need to remember that adding the else clause is purely optional on the other handyou must add at least one except clause