python 断言

#断言
a ='testing'
if type(a) is int:
print('error')

assert type(a) is str#为True
assert type(a) is int#为False。错误信息:AssertionError


print('test1')
posted @ 2020-07-31 22:21  安好_世界  阅读(113)  评论(0编辑  收藏  举报