断言的使用

>>> x = 1
>>> y = 2
>>> assert x == y, "not equals"

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    assert x == y, "not equals"
AssertionError: not equals
>>> 

 

posted @ 2018-08-27 09:13  道高一尺  阅读(176)  评论(0编辑  收藏  举报