check whether a condition is true and raises an AssertionError (optionally with a supplied error message) if it isn't. : assert « Statement « Python Tutorial






age = 12
assert age >= 12, 'Children under the age of 12 are not allowed'
3.17.assert
3.17.1.check whether a condition is true and raises an AssertionError (optionally with a supplied error message) if it isn't.
3.17.2.Assertions