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')
原文地址:https://www.cnblogs.com/anhao-world/p/13412572.html