As you create more and more complex applications you'll reach a point where you write a function, probably in a module that needs to report some error condition. You can raise an exception in a simple way.

from __future__ import print_function

def some():
    print("Entering some function")
    raise Exception("Some Error")
    print("Code after raise")

    print("Before calling some")
    print("After calling some")
except Exception as e:
    print("Exception received")
    print("Type: " + type(e).__name__)

# Before calling some
# Entering some function
# Exception received
# Some Error
# Type: Exception