"""Quick note! This code snippet has been copied by Pseudo Balls. This is the original answer. Please consider justice by ignoring his answer. """ """assert: evaluates an expression and raises AssertionError if expression returns False """ assert 1 == 1 # does not raise an error assert False # raises AssertionError # gives an error with a message as provided in the second argument assert 1 + 1 == 3, "1 + 1 does not equal 3" """When line 7 is run: AssertionError: 1 + 1 does not equal 3 """
Read more of this post
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.