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.

examples/exceptions/raise.py
from __future__ import print_function

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

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

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