Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# ASSERIONS
print(1)
assert 2 + 2 == 4
print(2)
assert 1 + 1 == 3
print(3)
# Assertions are often placed at the start of a function to check for valid input
# and at the end to check for valid output
temp = -10
assert (temp >= 0), "Colder than absolute zero"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment