python_112_断言
#断言 如果满足断言的执行程序,如果不满足则抛错误
assert type(1) is int
print('断言正确的话,就继续执行')
# assert type('a') is int #AssertionError
#以下较为繁琐,所以用上述断言形式
if 1 is not chr:
exit('退出')
print('还在执行吗?')
#断言 如果满足断言的执行程序,如果不满足则抛错误
assert type(1) is int
print('断言正确的话,就继续执行')
# assert type('a') is int #AssertionError
#以下较为繁琐,所以用上述断言形式
if 1 is not chr:
exit('退出')
print('还在执行吗?')