grammatical format
assert expression , AssertionError
# 等价于
if not expression:
raise AssertionError(arguments)
assrt is equivalent to an if conditional judgment statement, but it can simplify the code better.
effect
Simplify the code and reduce the use of if statements. It is generally used in the development process of the code and will not appear in the product.