raising exceptions in principlean exception is just an object there are many different exception classes availableand we can easily define more of our own the one thing they all have in common is that they inherit from built-in class called baseexception these exception objects become special when they are handled inside the program' flow of control when an exception occurseverything that was supposed to happen doesn' happenunless it was supposed to happen when an exception occurred make sensedon' worryit willthe easiest way to cause an exception to occur is to do something sillychances are you've done this already and seen the exception output for exampleany time python encounters line in your program that it can' understandit bails with syntaxerrorwhich is type of exception here' common oneprint "hello worldfile ""line print "hello worldsyntaxerrorinvalid syntax this print statement was valid command in python and previous versionsbut in python because print is now functionwe have to enclose the arguments in parenthesis soif we type the preceding command into python interpreterwe get the syntaxerror in addition to syntaxerrorsome other common exceptionswhich we can handleare shown in the following examplex traceback (most recent call last)file ""line in zerodivisionerrorint division or modulo by zero lst [ , , print(lst[ ]traceback (most recent call last)file ""line in indexerrorlist index out of range lst traceback (most recent call last)