To throw an exception with Python code, you use the code example Example: throw error python raise Exception("Error")