+ 3
The assert statement exists in almost every programming language. When you do... assert condition ... you're telling the program to test that condition, and trigger an error if the condition is false. In Python, it's roughly equivalent to this: if not condition: raise AssertionError() Try it in the Python shell: >>> assert True # nothing happens >>> assert False Traceback (most recent call last): File "<stdin>", line 1, in <module> AssertionError Assertions can include an optional message, and you can disable them when you're done debugging. For details: https://stackoverflow.com/questions/5142418/what-is-the-use-of-assert-in-python
20th Apr 2018, 6:32 AM
📈SmileGoodHope📈
📈SmileGoodHope📈 - avatar