demo_ref_keyword_assert.py:
x = "hello" #if condition returns True, then nothing happens: assert x == "hello" #if condition returns False, AssertionError is raised: assert x == "goodbye"
➜ begtut>python demo_keyword_assert.py
Traceback (most recent call last):
File "demo_ref_keyword_assert.py", line 5, in <module>
assert x == "goodbye"
AssertionError