Skip to content

Instantly share code, notes, and snippets.

@ItsCosmas
Created May 9, 2019 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ItsCosmas/547644f1bc8240bf0164b93830160273 to your computer and use it in GitHub Desktop.
Save ItsCosmas/547644f1bc8240bf0164b93830160273 to your computer and use it in GitHub Desktop.
# 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