The assert statement is used to check if a condition is true, and if not, raise an error:

assert(x > 0, "x must be positive")
Comments