Created
May 9, 2019 08:56
-
-
Save ItsCosmas/547644f1bc8240bf0164b93830160273 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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