Raising exceptions with raise

Premium

You can trigger exceptions yourself with the raise keyword. This is the standard Python way to signal that an input is invalid or a precondition was not met.