7.A. Assertions (contract) - JulTob/Python GitHub Wiki
Assertions
An assertion checks a statement. If its false, it raises an error.
temp = -10
assert (temp >= 0), “Colder than 0”
AssertionError: Colder than 0
An assertion checks a statement. If its false, it raises an error.
temp = -10
assert (temp >= 0), “Colder than 0”
AssertionError: Colder than 0